a HTML fragment
a file which jsdom will load HTML from; the resulting document's URL will be a file:// URL.
sets the resulting document's URL, which is reflected in various properties like document.URL and location.href, and is also used for cross-origin request restrictions. If config.html and config.file are not provided, jsdom will load HTML from this URL.
an array of JavaScript strings that will be evaluated against the resulting document. Similar to scripts, but it accepts JavaScript instead of paths/URLs.
cookie jar which will be used by document and related resource requests. Can be created by jsdom.createCookieJar() method. Useful to share cookie state among different documents as browsers does.
either "auto", "html", or "xml". The default is "auto", which uses HTML behavior unless config.url responds with an XML Content-Type, or config.file contains a filename ending in .xml or .xhtml. Setting to "xml" will attempt to parse the document as an XHTML document. (jsdom is currently only OK at doing that.)
the new document will have this referrer.
manually set a cookie value, e.g. 'key=value; expires=Wed, Sep 21 2011 12:00:00 GMT; path=/'. Accepts cookie string or array of cookie strings.
an object giving any headers that will be used while loading the HTML from config.url, if applicable.
the user agent string used in requests; defaults to Node.js (#process.platform#; U; rv:#process.version#)
see Flexibility section below. Note: the default feature set for jsdom.env does not include fetching remote JavaScript and executing it. This is something that you will need to carefully enable yourself.
a function that intercepts subresource requests and allows you to re-route them, modify, or outright replace them with your own content. More below.
config.onload, config.created: see below.
the maximum amount of NodeIterators that you can use at the same time. The default is 10; setting this to a high value will hurt performance.
a virtual console instance that can capture the window’s console output; see the "Capturing Console Output" examples.
an object describing which agents to use for the requests; defaults to { maxSockets: 6 }, see request module for more details.
http(s).Agent instance to use
alternatively specify your agent's class name
the agent options; defaults to { keepAlive: true, keepAliveMsecs: 115000 }, see http api for more details.
if true, requires SSL certificates be valid; defaults to true, see request module for more details.
a URL for a HTTP proxy to use for the requests.
http(s).Agent instance to use
alternatively specify your agent's class name
the agent options; defaults to { keepAlive: true, keepAliveMsecs: 115000 }, see http api for more details.
the maximum amount of NodeIterators that you can use at the same time.
the maximum amount of NodeIterators that you can use at the same time. The default is 10; setting this to a high value will hurt performance.
manually set a cookie value, e.g.
manually set a cookie value, e.g. 'key=value; expires=Wed, Sep 21 2011 12:00:00 GMT; path=/'. Accepts cookie string or array of cookie strings.
cookie jar which will be used by document and related resource requests.
cookie jar which will be used by document and related resource requests. Can be created by jsdom.createCookieJar() method. Useful to share cookie state among different documents as browsers does.
config.onload, config.created: see below.
see Flexibility section below.
see Flexibility section below. Note: the default feature set for jsdom.env does not include fetching remote JavaScript and executing it. This is something that you will need to carefully enable yourself.
a file which jsdom will load HTML from; the resulting document's URL will be a file:// URL.
an object giving any headers that will be used while loading the HTML from config.url, if applicable.
a HTML fragment
either "auto", "html", or "xml".
either "auto", "html", or "xml". The default is "auto", which uses HTML behavior unless config.url responds with an XML Content-Type, or config.file contains a filename ending in .xml or .xhtml. Setting to "xml" will attempt to parse the document as an XHTML document. (jsdom is currently only OK at doing that.)
an object describing which agents to use for the requests; defaults to { maxSockets: 6 }, see request module for more details.
a URL for a HTTP proxy to use for the requests.
the new document will have this referrer.
a function that intercepts subresource requests and allows you to re-route them, modify, or outright replace them with your own content.
a function that intercepts subresource requests and allows you to re-route them, modify, or outright replace them with your own content. More below.
an array of JavaScript strings that will be evaluated against the resulting document.
an array of JavaScript strings that will be evaluated against the resulting document. Similar to scripts, but it accepts JavaScript instead of paths/URLs.
if true, requires SSL certificates be valid; defaults to true, see request module for more details.
sets the resulting document's URL, which is reflected in various properties like document.URL and location.href, and is also used for cross-origin request restrictions.
sets the resulting document's URL, which is reflected in various properties like document.URL and location.href, and is also used for cross-origin request restrictions. If config.html and config.file are not provided, jsdom will load HTML from this URL.
the user agent string used in requests; defaults to Node.js (#process.platform#; U; rv:#process.version#)
a virtual console instance that can capture the window’s console output; see the "Capturing Console Output" examples.
JsDom Configuration Options