|
@@ -59,7 +59,12 @@ class DTCookiePool(PageCookiePool):
|
|
|
js_func = re.sub(gox, "return document['cookie']\n};", js_func)
|
|
|
js_func = '''const jsdom = require("jsdom");
|
|
|
const {JSDOM} = jsdom;
|
|
|
- const dom = new JSDOM(`<!DOCTYPE html><p>Hello world</p>`);
|
|
|
+ const dom = new JSDOM(`<!DOCTYPE html><p>Hello world</p>`,
|
|
|
+ {
|
|
|
+ url: "https://example.org/",
|
|
|
+ referrer: "https://example.com/",
|
|
|
+ contentType: "text/html",
|
|
|
+ });
|
|
|
window = dom.window;
|
|
|
document = window.document;''' + js_func
|
|
|
ctx = execjs.compile(js_func)
|