|
|
@@ -83,7 +83,7 @@ exports.getPageData = async options => {
|
|
|
const win = dom.window;
|
|
|
const doc = win.document;
|
|
|
let scripts = (await Promise.all(SCRIPTS.concat(options.browserScripts).map(scriptPath => fs.readFileSync(require.resolve(scriptPath)).toString()))).join("\n");
|
|
|
- scripts = "this.browser = { runtime: { getURL:() => " + JSON.stringify(require.resolve("../../lib/hooks/hooks-web.js")) + " } }" + scripts;
|
|
|
+ scripts = "this.getFileContent = () => `" + fs.readFileSync(require.resolve("../../lib/hooks/hooks-web.js")) + "`;" + scripts;
|
|
|
dom.window.eval(scripts);
|
|
|
if (dom.window.document.readyState == "loading") {
|
|
|
await new Promise(resolve => win.document.onload = resolve);
|