misc fixes to headless template (#5239)

patch-1
Sandeep Singh 2022-08-29 14:40:50 +05:30 committed by GitHub
parent 80235aa6a3
commit d89bda1d65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 4 deletions

View File

@ -11,7 +11,9 @@ headless:
- args:
url: "{{BaseURL}}"
action: navigate
- action: waitload
- action: script
name: extract
args:
@ -19,6 +21,7 @@ headless:
() => {
return '\n' + [...new Set(Array.from(document.querySelectorAll('[src], [href], [url], [action]')).map(i => i.src || i.href || i.url || i.action))].join('\r\n') + '\n'
}
extractors:
- type: kval
part: extract

View File

@ -15,6 +15,7 @@ headless:
part: response
key: Content-Security-Policy
value: "default-src * 'unsafe-inline' 'unsafe-eval' data: blob:;"
- action: script
args:
hook: true
@ -45,19 +46,24 @@ headless:
}
};
}
- args:
url: "{{BaseURL}}"
action: navigate
- action: waitload
- action: script
name: alerts
args:
code: window.alerts
code: |
() => { window.alerts }
matchers:
- type: word
part: alerts
words:
- "at window.postMessage"
extractors:
- type: kval
part: alerts

View File

@ -15,6 +15,7 @@ headless:
part: response
key: Content-Security-Policy
value: "default-src * 'unsafe-inline' 'unsafe-eval' data: blob:;"
- action: script
args:
hook: true
@ -45,19 +46,24 @@ headless:
return oldListener.apply(this, arguments);
};
}
- args:
url: "{{BaseURL}}"
action: navigate
- action: waitload
- action: script
name: alerts
args:
code: window.alerts
code: |
() => { window.alerts }
matchers:
- type: word
part: alerts
words:
- "at Window.addEventListener"
extractors:
- type: kval
part: alerts

View File

@ -81,15 +81,19 @@ headless:
url: "{{BaseURL}}"
action: navigate
- action: waitload
- action: script
name: alerts
args:
code: window.alerts
code: |
() => { window.alerts }
matchers:
- type: word
part: alerts
words:
- "__proto__"
extractors:
- type: kval
part: alerts

View File

@ -15,6 +15,7 @@ headless:
part: response
key: Content-Security-Policy
value: "default-src * 'unsafe-inline' 'unsafe-eval' data: blob:;"
- action: script
args:
hook: true
@ -63,19 +64,24 @@ headless:
return oldEval.apply(this, arguments);
};
}
- args:
url: "{{BaseURL}}"
action: navigate
- action: waitload
- action: script
name: alerts
args:
code: window.alerts
code: |
() => { window.alerts }
matchers:
- type: word
part: alerts
words:
- "sink:"
extractors:
- type: kval
part: alerts