diff --git a/src/js/scriptlets/noscript-spoof.js b/src/js/scriptlets/noscript-spoof.js index 76f7896b8..2e6f0fdf7 100644 --- a/src/js/scriptlets/noscript-spoof.js +++ b/src/js/scriptlets/noscript-spoof.js @@ -42,7 +42,14 @@ if ( meta === null ) { return; } let match = reMetaContent.exec(meta.getAttribute('content')); if ( match === null || match[3].trim() === '' ) { return; } - let url = new URL(match[3], document.baseURI); + + let url; + try { + url = new URL(match[3], document.baseURI); + } catch(ex) { + return; + } + if ( reSafeURL.test(url.href) === false ) { return; } redirectTimer = setTimeout(( ) => { location.assign(url.href);