Improve script URL detection logic (#150045)

This commit is contained in:
Thomas Watson 2023-02-01 19:24:28 +01:00 committed by GitHub
parent fea634d9a4
commit 3fbbbd4c24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,8 +46,9 @@ function getColor(rules, colorKey, value) {
}
function sanitizeUrl(url) {
const { protocol } = parseUrl(url);
// eslint-disable-next-line no-script-url
if (parseUrl(url).protocol === 'javascript:') {
if (protocol === 'javascript:' || protocol === 'data:' || protocol === 'vbscript:') {
return '';
}
return url;