Skip to content

Commit fba6c9a

Browse files
OrKoNDevtools-frontend LUCI CQ
authored andcommitted
[Freestyler] limit the number of console APIs in scope
Bug: 376396077 Change-Id: I98fa134ba73c83f58b07057ac9eed60469811f34 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5975679 Reviewed-by: Ergün Erdoğmuş <[email protected]> Commit-Queue: Alex Rudenko <[email protected]>
1 parent 13074bd commit fba6c9a

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

front_end/panels/freestyler/FreestylerAgent.ts

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,35 @@ export class FreestylerAgent extends AiAgent<SDK.DOMModel.DOMNode> {
396396
canceled: boolean,
397397
}> {
398398
const actionExpression = `{
399-
const scope = {$0, $1, getEventListeners};
399+
const scope = {
400+
$0,
401+
$1,
402+
// restricted
403+
getEventListeners: undefined,
404+
$_: undefined,
405+
$2: undefined,
406+
$3: undefined,
407+
$4: undefined,
408+
$$: undefined,
409+
$x: undefined,
410+
clear: undefined,
411+
copy: undefined,
412+
debug: undefined,
413+
dir: undefined,
414+
dirxml: undefined,
415+
inspect: undefined,
416+
keys: undefined,
417+
monitor: undefined,
418+
monitorEvents: undefined,
419+
profile: undefined,
420+
profileEnd: undefined,
421+
queryObjects: undefined,
422+
table: undefined,
423+
undebug: undefined,
424+
unmonitor: undefined,
425+
unmonitorEvents: undefined,
426+
values: undefined,
427+
};
400428
with (scope) {
401429
${action}
402430
;((typeof data !== "undefined") ? data : undefined)

0 commit comments

Comments
 (0)