Fixed URL matching regexp (thanks insertscript).

This commit is contained in:
hackademix 2020-03-21 01:55:22 +01:00
parent e1cf2bb670
commit 8b3a36b2e4
1 changed files with 1 additions and 1 deletions

View File

@ -118,7 +118,7 @@ notifyPage();
addEventListener("DOMContentLoaded", e => {
if (ns.canScript) return;
for (let m of document.querySelectorAll("meta[http-equiv=refresh]")) {
if (/^[^,;]*[,;]\W*url[^=]*=[^!#$%&'()*+,/:;=?@[\]\w.,~-]*data:/i.test(m.getAttribute("content"))) {
if (/^[^,;]*[,;]\W*url[^=]*=[^!#$%&()*+,/:;=?@[\]\w.,~-]*data:/i.test(m.getAttribute("content"))) {
let url = m.getAttribute("content").replace(/.*?(?=data:)/i, "");
log(`Blocking refresh to ${url}`);
window.stop();