lib/grover/js/processor.js in grover-0.14.1 vs lib/grover/js/processor.js in grover-0.14.2
- old
+ new
@@ -99,9 +99,25 @@
} else {
await page.emulateMedia(emulateMedia);
}
}
+ // add styles (if provided)
+ const styleTagOptions = options.styleTagOptions; delete options.styleTagOptions;
+ if (Array.isArray(styleTagOptions)) {
+ for (const styleTagOption of styleTagOptions) {
+ await page.addStyleTag(styleTagOption);
+ }
+ }
+
+ // add scripts (if provided)
+ const scriptTagOptions = options.scriptTagOptions; delete options.scriptTagOptions;
+ if (Array.isArray(scriptTagOptions)) {
+ for (const scriptTagOption of scriptTagOptions) {
+ await page.addScriptTag(scriptTagOption);
+ }
+ }
+
// If specified, evaluate script on the page
const executeScript = options.executeScript; delete options.executeScript;
if (executeScript !== undefined) {
await page.evaluate(executeScript);
}