Skip to content

Commit 57f7a2a

Browse files
authored
fix: set runScripts to false by default for JSDOM Scraper (#505)
Sets `runScripts` input option of JSDOM Scraper to `false` by default. Adds a vulnerability warning to the tooltip of the option.
1 parent 2bfad85 commit 57f7a2a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/actor-scraper/jsdom-scraper/INPUT_SCHEMA.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@
6868
"runScripts": {
6969
"title": "Run scripts",
7070
"type": "boolean",
71-
"default": true,
72-
"description": "Whether to execute JavaScript in the downloaded page. If enabled, the JSDOM engine will process the JavaScript in the page as if it was loaded in a browser. This is useful for pages that use JavaScript to render the content, but it can also cause secuirty issues."
71+
"default": false,
72+
"prefill": false,
73+
"description": "Whether to execute JavaScript in the downloaded page. If enabled, the JSDOM engine will process the JavaScript in the page as if it was loaded in a browser. This is useful for pages that use JavaScript to render the content.\n\n⚠️ Warning ⚠️\n\nThis option allows potentially malicious scripts to be executed in the context of the Actor. Only enable this option if you trust the target website."
7374
},
7475
"showInternalConsole": {
7576
"title": "Show internal console logs",

packages/actor-scraper/jsdom-scraper/src/internals/crawler_setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export class CrawlerSetup implements CrawlerSetupOptions {
222222
proxyConfiguration: this.proxyConfiguration,
223223
requestHandler: this._requestHandler.bind(this),
224224
preNavigationHooks: [],
225-
runScripts: this.input.runScripts ?? true,
225+
runScripts: this.input.runScripts ?? false,
226226
hideInternalConsole: !(this.input.showInternalConsole ?? false),
227227
postNavigationHooks: [],
228228
requestQueue: this.requestQueue,

0 commit comments

Comments
 (0)