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,EAAE,OAAO,EAAP,OAAO,EAAE,QAAQ,EAAR,QAAQ,EAAE,QAAQ,EAAR,QAAQ,EAAE,CAAC,CAAC;GAE3D,CAAC,CAAC;AACH,SAAO,QAAQ,CAAC;CACjB,CAAC","file":"document.js","sourcesContent":["// Exports a function for creating/loading new documents.\n\nconst assert = require('assert');\nconst browserFeatures = require('jsdom/lib/jsdom/browser/documentfeatures');\nconst Fetch = require('./fetch');\nconst DOM = require('./dom');\nconst EventSource = require('eventsource');\nconst iconv = require('iconv-lite');\nconst QS = require('querystring');\nconst resourceLoader = require('jsdom/lib/jsdom/browser/resource-loader');\nconst Resources = require('./resources');\nconst URL = require('url');\nconst Utils = require('jsdom/lib/jsdom/utils');\nconst VM = require('vm');\nconst WebSocket = require('ws');\nconst Window = require('jsdom/lib/jsdom/browser/Window');\nconst XMLHttpRequest = require('./xhr');\n\n\n// File access, not implemented yet\nclass File {\n}\n\n\n// Screen object provides access to screen dimensions\nclass Screen {\n constructor() {\n this.top = this.left = 0;\n this.width = 1280;\n this.height = 800;\n }\n\n get availLeft() {\n return 0;\n }\n get availTop() {\n return 0;\n }\n get availWidth() {\n return 1280;\n }\n get availHeight() {\n return 800;\n }\n get colorDepth() {\n return 24;\n }\n get pixelDepth() {\n return 24;\n }\n}\n\n\n// DOM implementation of URL class\nclass DOMURL {\n\n constructor(url, base) {\n if (url == null)\n throw new TypeError('Failed to construct \\'URL\\': Invalid URL');\n if (base)\n url = Utils.resolveHref(base, url);\n const parsed = URL.parse(url || 'about:blank');\n const origin = parsed.protocol && parsed.hostname && `${parsed.protocol}//${parsed.hostname}`;\n Object.defineProperties(this, {\n hash: { value: parsed.hash, enumerable: true },\n host: { value: parsed.host, enumerable: true },\n hostname: { value: parsed.hostname, enumerable: true },\n href: { value: URL.format(parsed), enumerable: true },\n origin: { value: origin, enumerable: true },\n password: { value: parsed.password, enumerable: true },\n pathname: { value: parsed.pathname, enumerable: true },\n port: { value: parsed.port, enumerable: true },\n protocol: { value: parsed.protocol, enumerable: true },\n search: { value: parsed.search, enumerable: true },\n username: { value: parsed.username, enumerable: true }\n });\n }\n\n toString() {\n return this.href;\n }\n\n}\n\n\nfunction setupWindow(window, args) {\n const { document } = window;\n const { browser, history } = args;\n const { parent, opener } = args;\n\n let closed = false;\n\n // Catch all errors\n window.onerror = ((message, filename, lineno, colno, error) => {\n window._eventQueue.enqueue(() => browser.emit('error', error));\n });\n\n // Access to browser\n Object.defineProperty(window, 'browser', {\n value: browser,\n enumerable: true\n });\n\n window.name = args.name || '';\n\n // If this was opened from another window\n window.opener = opener && opener._globalProxy;\n // Frames provide their own parent reference\n window._parent = (parent || window);\n window._top = (parent || window).top;\n\n window.console = browser.console;\n\n // All the resources loaded by this window.\n window.resources = new Resources(window);\n\n // javaEnabled, present in browsers, not in spec Used by Google Analytics see\n /// https://developer.mozilla.org/en/DOM/window.navigator.javaEnabled\n const emptySet = [];\n emptySet.item = ()=> undefined;\n emptySet.namedItem = ()=> undefined;\n window.navigator = {\n appName: 'Zombie',\n appVersion: browser.constructor.VERSION,\n cookieEnabled: true,\n javaEnabled: ()=> false,\n language: browser.language,\n mimeTypes: emptySet,\n noUI: true,\n platform: process.platform,\n plugins: emptySet,\n userAgent: browser.userAgent,\n vendor: 'Zombie Industries'\n };\n\n // Add cookies, storage, alerts/confirm, XHR, WebSockets, JSON, Screen, etc\n Object.defineProperty(window, 'cookies', {\n get() {\n return browser.cookies.serialize(this.location.hostname, this.location.pathname);\n }\n });\n browser._storages.extend(window);\n\n window.File = File;\n window.Event = DOM.Event;\n window.MouseEvent = DOM.MouseEvent;\n window.MutationEvent = DOM.MutationEvent;\n window.UIEvent = DOM.UIEvent;\n window.screen = new Screen();\n\n // Fetch API\n window.fetch = window.resources._fetch.bind(window.resources);\n window.Request = Fetch.Request;\n window.Response = Fetch.Response;\n window.FormData = Fetch.FormData;\n\n // Base-64 encoding/decoding\n window.atob = (string)=> new Buffer(string, 'base64').toString('utf8');\n window.btoa = (string)=> new Buffer(string, 'utf8').toString('base64');\n\n // Constructor for XHLHttpRequest\n window.XMLHttpRequest = ()=> new XMLHttpRequest(window);\n window.URL = DOMURL;\n\n // Web sockets\n window._allWebSockets = [];\n\n window.WebSocket = function(url, protocol) {\n url = resourceLoader.resolveResourceUrl(document, url);\n const origin = `${window.location.protocol}//${window.location.host}`;\n const ws = new WebSocket(url, { origin, protocol });\n\n // The < 1.x implementations of ws used to allows 'buffer' to be defined\n // as the binary type in node environments. Now, the supported type is\n // 'nodebuffer'. Version of engine.io-client <= 1.6.12 use the 'buffer'\n // type and this is a shim to allow that to keep working unti that version\n // of engine.io-client does not need to be supported anymore\n const origProperty = Object.getOwnPropertyDescriptor(WebSocket.prototype, 'binaryType');\n Object.defineProperty(ws, 'binaryType', {\n get: function get() {\n return origProperty.get.call(this);\n },\n set: function set(type) {\n if (type === 'buffer') {\n type = 'nodebuffer';\n }\n return origProperty.set.call(this, type);\n }\n });\n window._allWebSockets.push(ws);\n return ws;\n };\n\n window.Image = function(width, height) {\n const img = new DOM.HTMLImageElement(window.document);\n img.width = width;\n img.height = height;\n return img;\n };\n\n // DataView: get from globals\n window.DataView = DataView;\n\n window.resizeTo = function(width, height) {\n window.outerWidth = window.innerWidth = width;\n window.outerHeight = window.innerHeight = height;\n };\n window.resizeBy = function(width, height) {\n window.resizeTo(window.outerWidth + width, window.outerHeight + height);\n };\n\n // Some libraries (e.g. Backbone) check that this property exists before\n // deciding to use onhashchange, so we need to set it to null.\n window.onhashchange = null;\n\n\n\n // -- JavaScript evaluation\n\n // Evaluate in context of window. This can be called with a script (String) or a function.\n window._evaluate = function(code, filename) {\n const originalInScope = browser._windowInScope;\n try {\n // The current window, postMessage and window.close need this\n browser._windowInScope = window;\n let result;\n if (typeof code === 'string' || code instanceof String)\n result = VM.runInContext(code, window, { filename });\n else if (code)\n result = code.call(window);\n browser.emit('evaluated', code, result, filename);\n return result;\n } catch (error) {\n error.filename = error.filename || filename;\n throw error;\n } finally {\n browser._windowInScope = originalInScope;\n }\n };\n\n\n // -- Event loop --\n\n const eventQueue = browser._eventLoop.createEventQueue(window);\n Object.defineProperty(window, '_eventQueue', {\n value: eventQueue\n });\n window.setTimeout = eventQueue.setTimeout.bind(eventQueue);\n window.clearTimeout = eventQueue.clearTimeout.bind(eventQueue);\n window.setInterval = eventQueue.setInterval.bind(eventQueue);\n window.clearInterval = eventQueue.clearInterval.bind(eventQueue);\n window.setImmediate = (fn)=> eventQueue.setTimeout(fn, 0);\n window.clearImmediate = eventQueue.clearTimeout.bind(eventQueue);\n window.requestAnimationFrame = window.setImmediate;\n window.cancelAnimationFrame = window.clearImmediate;\n\n\n // Constructor for EventSource, URL is relative to document's.\n window.EventSource = function(url) {\n url = resourceLoader.resolveResourceUrl(document, url);\n const eventSource = new EventSource(url);\n eventQueue.addEventSource(eventSource);\n return eventSource;\n };\n\n\n // -- Interaction --\n\n window.alert = function(message) {\n const handled = browser.emit('alert', message);\n if (!handled)\n browser.log('Unhandled window.alert(\"%s\")');\n browser.log('alert(\"%s\")', message);\n };\n\n window.confirm = function(question) {\n const event = { question, response: true };\n const handled = browser.emit('confirm', event);\n if (!handled)\n browser.log('Unhandled window.confirm(\"%s\")');\n const response = !!event.response;\n browser.log('confirm(\"%s\") -> %ss', question, response);\n return response;\n };\n\n window.prompt = function(question, value) {\n const event = { question, response: value || '' };\n const handled = browser.emit('prompt', event);\n if (!handled)\n browser.log('Unhandled window.prompt(\"%s\")');\n const response = (event.response || '').toString();\n browser.log('prompt(\"..\") -> \"%s\"', question, response);\n return response;\n };\n\n\n // -- Opening and closing --\n\n // Open one window from another.\n window.open = function(url, name) {\n url = url && resourceLoader.resolveResourceUrl(document, url);\n return browser.tabs.open({ name: name, url: url, opener: window });\n };\n\n // Indicates if window was closed\n Object.defineProperty(window, 'closed', {\n get() { return closed; },\n enumerable: true\n });\n\n // Used by window.close() and also from history.destroy/replace/etc\n // global.\n window._destroy = function() {\n // We call history.destroy which calls destroy on all windows, so need to\n // avoid infinite loop.\n if (closed)\n return;\n closed = true;\n\n for (const ws of window._allWebSockets) {\n ws.removeAllListeners();\n ws.close();\n }\n\n // Close all frames first\n for (let i = 0; i < window._length; ++i)\n if (window[i])\n window[i].close();\n // kill event queue, document and window.\n eventQueue.destroy();\n document.close();\n };\n\n // window.close actually closes the tab, and disposes of all windows in the history.\n // Also used to close iframe.\n window.close = function() {\n if (parent || closed)\n return;\n\n // Only opener window can close window; any code that's not running from\n // within a window's context can also close window.\n if (browser._windowInScope === opener || browser._windowInScope === null) {\n browser.tabs._closed(window);\n // Only parent window gets the close event\n browser.emit('closed', window);\n history.destroy(); // do this last to prevent infinite loop\n } else\n browser.log('Scripts may not close windows that were not opened by script');\n };\n\n\n // -- Navigating --\n\n // Each window maintains its own view of history\n const windowHistory = {\n forward() {\n windowHistory.go(1);\n },\n back() {\n windowHistory.go(-1);\n },\n go(amount) {\n history.go(amount);\n },\n pushState(...stateArgs) {\n history.pushState(...stateArgs);\n },\n replaceState(...stateArgs) {\n history.replaceState(...stateArgs);\n },\n dump(output) {\n history.dump(output);\n }\n };\n Object.defineProperties(windowHistory, {\n length: {\n get() { return history.length; },\n enumerable: true\n },\n state: {\n get() { return history.state; },\n enumerable: true\n }\n });\n\n // DOM History object\n window.history = windowHistory;\n /// Actual history, see location getter/setter\n window._history = history;\n\n // Read/write access to window.location\n Object.defineProperty(window, 'location', {\n get() {\n return document.location;\n },\n set(url) {\n history.assign(url);\n }\n });\n\n\n // Form submission uses this\n window._submit = function(formArgs) {\n const url = resourceLoader.resolveResourceUrl(document, formArgs.url);\n const target = formArgs.target || '_self';\n browser.emit('submit', url, target);\n // Figure out which history is going to handle this\n const targetWindow =\n (target === '_self') ? window :\n (target === '_parent') ? window.parent :\n (target === '_top') ? window.top :\n browser.tabs.open({ name: target });\n const modified = Object.assign({}, formArgs, { url, target });\n targetWindow._history.submit(modified);\n };\n\n // Overload jsdom postMessage function, which is added to the window object\n // when created jsdom/lib/jsdom/browser/Window.js.\n // This is needed because jsdom's implementation does not define the source\n // and origin attributes in the issued events.\n // This implementation should be dropped in favor of\n // jsdom/lib/jsdom/living/post-message.js when it supports source and origin.\n window.postMessage = function(data) {\n // Window A (source) calls B.postMessage, to determine A we need the\n // caller's window.\n\n // DDOPSON-2012-11-09 - _windowInScope.getGlobal() is used here so that for\n // website code executing inside the sandbox context, event.source ==\n // window. Even though the _windowInScope object is mapped to the sandboxed\n // version of the object returned by getGlobal, they are not the same object\n // ie, _windowInScope.foo == _windowInScope.getGlobal().foo, but\n // _windowInScope != _windowInScope.getGlobal()\n const source = (this.browser._windowInScope || this);\n\n const origin = source.location;\n const eventOrigin = URL.format({ protocol: origin.protocol, host: origin.host });\n\n const event = this.document.createEvent('MessageEvent');\n event.initMessageEvent('message', false, false, data, eventOrigin, null, source, []);\n\n this.dispatchEvent(event);\n };\n\n // Inject HTMLDocument.hasFocus function\n // https://developer.mozilla.org/en-US/docs/Web/API/Document/hasFocus\n window._document.hasFocus = function() {\n return browser.tabs.current.document === this;\n };\n\n // JSDOM fires DCL event on document but not on window\n function windowLoaded(event) {\n document.removeEventListener('DOMContentLoaded', windowLoaded);\n\n // JSDom > 7.1 does not allow re-dispatching the same event, so\n // a copy of the event needs to be created for the new dispatch\n const windowContentLoaded = document.createEvent('HTMLEvents');\n windowContentLoaded.initEvent('DOMContentLoaded', false, false);\n window.dispatchEvent(windowContentLoaded);\n }\n document.addEventListener('DOMContentLoaded', windowLoaded);\n\n // Window is now open, next load the document.\n browser.emit('opened', window);\n}\n\n\n// Change location\nDOM.Document.prototype.__defineSetter__('location', function(url) {\n this.defaultView.location = url;\n});\n\n\n// Creates an returns a new document attached to the window.\nfunction createDocument(args) {\n const { browser } = args;\n\n const features = {\n FetchExternalResources: [],\n ProcessExternalResources: [],\n MutationEvents: '2.0'\n };\n if (args.browser.hasFeature('scripts', true)) {\n features.FetchExternalResources.push('script');\n features.ProcessExternalResources.push('script');\n }\n if (args.browser.hasFeature('css', false)) {\n features.FetchExternalResources.push('css');\n features.FetchExternalResources.push('link');\n }\n if (args.browser.hasFeature('img', false))\n features.FetchExternalResources.push('img');\n if (args.browser.hasFeature('iframe', true))\n features.FetchExternalResources.push('iframe');\n\n const window = new Window({\n parsingMode: 'html',\n contentType: 'text/html',\n url: args.url,\n referrer: args.referrer\n });\n const { document } = window;\n browserFeatures.applyDocumentFeatures(document, features);\n setupWindow(window, args);\n\n // Give event handler chance to register listeners.\n args.browser.emit('loading', document);\n return document;\n}\n\n\n// Get refresh URL and timeout from <meta> tag\nfunction getMetaRefresh(document) {\n const refresh = document.querySelector('meta[http-equiv=\"refresh\"]');\n if (refresh) {\n const content = refresh.getAttribute('content');\n const match = content.match(/^\\s*(\\d+)(?:\\s*;\\s*url\\s*=\\s*(.*?))?\\s*(?:;|$)/i);\n if (match) {\n const refreshTimeout = parseInt(match[1], 10);\n const refreshURL = match[2] || document.location.href;\n if (refreshTimeout >= 0)\n return { refreshTimeout, refreshURL };\n }\n }\n return null;\n}\n\n\n// Find the charset= value of the meta tag\nconst MATCH_CHARSET = /<meta(?!\\s*(?:name|value)\\s*=)[^>]*?charset\\s*=[\\s\"']*([^\\s\"'\\/>]*)/i;\n\n// Extract HTML from response with the proper encoding:\n// - If content type header indicates charset use that\n// - Otherwise, look for <meta> tag with charset in body\n// - Otherwise, browsers default to windows-1252 encoding\nfunction getHTMLFromResponseBody(buffer, contentType) {\n const [mimeType, ...typeOptions] = contentType.split(/;\\s*/);\n\n // Pick charset from content type\n if (mimeType)\n for (let typeOption of typeOptions) {\n if (/^charset=/i.test(typeOption)) {\n const charset = typeOption.split('=')[1];\n return iconv.decode(buffer, charset);\n }\n }\n\n // Otherwise, HTML documents only, pick charset from meta tag\n // Otherwise, HTML documents only, default charset in US is windows-1252\n const charsetInMetaTag = buffer.toString().match(MATCH_CHARSET);\n if (charsetInMetaTag)\n return iconv.decode(buffer, charsetInMetaTag[1]);\n else\n return iconv.decode(buffer, 'windows-1252');\n}\n\n\n// Builds and returns a new Request, adding form parameters to URL (GET) or\n// request body (POST).\nfunction buildRequest(args) {\n const { browser, method } = args;\n const params = args.params || new Map();\n const site = /^(https?:|file:)/i.test(browser.site) ? browser.site : `http://${browser.site || 'locahost'}`;\n const url = Utils.resolveHref(site, URL.format(args.url));\n\n const headers = new Fetch.Headers(args.headers);\n\n // HTTP header Referer, but Document property referrer\n const referrer = args.referrer || browser.referrer || browser.referer || args.history.url;\n if (referrer && !headers.has('Referer'))\n headers.set('Referer', referrer);\n if (!headers.has('Accept'))\n headers.set('Accept', 'text/html,*/*');\n\n if (/^GET|HEAD|DELETE$/i.test(method)) {\n const uri = URL.parse(url, true);\n // These methods use query string parameters instead\n for (let [name, values] of params)\n uri.query[name] = values;\n return new Fetch.Request(URL.format(uri), { method, headers });\n }\n\n const mimeType = (args.encoding || '').split(';')[0].toLowerCase();\n // Default mime type, but can also be specified in form encoding\n if (mimeType === '' || mimeType === 'application/x-www-form-urlencoded') {\n const urlEncoded = [...params]\n .map(function([name, values]) {\n return values.map(value => `${QS.escape(name)}=${QS.escape(value)}`).join('&');\n })\n .join('&');\n\n headers.set('Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8');\n return new Fetch.Request(url, { method, headers, body: urlEncoded });\n }\n\n if (mimeType === 'multipart/form-data') {\n const form = new Fetch.FormData();\n for (let [name, values] of params)\n for (let value of values)\n form.append(name, value);\n return new Fetch.Request(url, { method, headers, body: form });\n }\n\n throw new TypeError(`Unsupported content type ${mimeType}`);\n}\n\n\n// Parse HTML response and setup document\nfunction parseResponse({ browser, history, document, response }) {\n const window = document.defaultView;\n window._request = response.request;\n window._response = response;\n history.updateLocation(window, response._url);\n\n const done = window._eventQueue.waitForCompletion();\n response\n ._consume()\n .then(function(body) {\n\n const contentType = response.headers.get('Content-Type') || '';\n const html = getHTMLFromResponseBody(body, contentType);\n response.body = html;\n document.write(html || '<html></html>');\n document.close();\n\n browser.emit('loaded', document);\n if (response.status >= 400)\n throw new Error(`Server returned status code ${response.status} from ${response.url}`);\n if (!document.documentElement)\n throw new Error(`Could not parse document at ${response.url}`);\n\n })\n .then(function() {\n\n // Handle meta refresh. Automatically reloads new location and counts\n // as a redirect.\n //\n // If you need to check the page before refresh takes place, use this:\n // browser.wait({\n // function: function() {\n // return browser.query('meta[http-equiv=\"refresh\"]');\n // }\n // });\n const refresh = getMetaRefresh(document);\n\n if (refresh) {\n const { refreshTimeout } = refresh;\n const { refreshURL } = refresh;\n\n window._eventQueue.setTimeout(function() {\n // Allow completion function to run\n window._eventQueue.enqueue(function() {\n window._eventQueue.enqueue(function() {\n // Count a meta-refresh in the redirects count.\n history.replace(refreshURL);\n // This results in a new window getting loaded\n const newWindow = history.current.window;\n newWindow.addEventListener('load', function() {\n ++newWindow._request._redirectCount;\n });\n });\n });\n }, refreshTimeout * 1000);\n }\n\n })\n .catch(function(error) {\n browser.emit('error', error);\n })\n .then(done);\n}\n\n\n// Load/create a new document.\n//\n// Named arguments:\n// browser - The browser (required)\n// history - Window history (required)\n// url - URL of document to open (defaults to \"about:blank\")\n// method - HTTP method (defaults to \"GET\")\n// encoding - Request content type (forms use this)\n// params - Additional request parameters (Map)\n// html - Create document with this content instead of loading from URL\n// name - Window name\n// referrer - HTTP referer header\n// parent - Parent document (for frames)\n// opener - Opening window (for window.open)\n// target - Target window name (for form.submit)\n//\n// Returns a new document with a new window. The document contents is loaded\n// asynchronously, and will trigger a loaded/error event.\nmodule.exports = function loadDocument(args) {\n const { browser, history, html, url } = args;\n assert(browser && browser.visit, 'Missing parameter browser');\n assert(history && history.reload, 'Missing parameter history');\n\n const document = createDocument(Object.assign({ url }, args));\n const window = document.defaultView;\n\n if (html) {\n window._eventQueue.enqueue(function() {\n document.write(html);\n document.close();\n browser.emit('loaded', document);\n });\n return document;\n }\n\n // Let's handle the specifics of each protocol\n if (!url || /^about:/.test(url)) {\n window._eventQueue.enqueue(function() {\n document.close();\n browser.emit('loaded', document);\n });\n return document;\n }\n\n if (/^javascript:/.test(url)) {\n window._eventQueue.enqueue(function() {\n document.close();\n try {\n window._evaluate(url.slice(11), 'javascript:');\n browser.emit('loaded', document);\n } catch (error) {\n browser.emit('error', error);\n }\n });\n return document;\n }\n\n const request = buildRequest(args);\n window._eventQueue.http(request, (error, response)=> {\n if (error) {\n document.write(`<html><body>${error.message}</body></html>`);\n document.close();\n browser.emit('error', error);\n } else\n parseResponse({ browser, history, document, response });\n\n });\n return document;\n};\n"]}