summaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
authorhackademix2020-03-20 22:20:28 +0100
committerhackademix2020-03-20 22:20:28 +0100
commitab2f078ca6e8aa694ccfecdf6d6107a2be90bd02 (patch)
treeaa59a61d219320b1af778ef4fe4c0ac5fe597794 /src/content
parent949d930662a98a8ccaf74ba11b7d1a5d3fb54c67 (diff)
downloadnoscript-ab2f078ca6e8aa694ccfecdf6d6107a2be90bd02.tar.gz
noscript-ab2f078ca6e8aa694ccfecdf6d6107a2be90bd02.tar.xz
noscript-ab2f078ca6e8aa694ccfecdf6d6107a2be90bd02.zip
More aggressive blocking for data: refresh attempts (thanks insertscript).
Diffstat (limited to 'src/content')
-rw-r--r--src/content/content.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/content/content.js b/src/content/content.js
index 43827a2..29330b7 100644
--- a/src/content/content.js
+++ b/src/content/content.js
@@ -118,8 +118,8 @@ notifyPage();
addEventListener("DOMContentLoaded", e => {
if (ns.canScript) return;
for (let m of document.querySelectorAll("meta[http-equiv=refresh]")) {
- if (/^[^,;]*[,;]url[^\w=]*=\s*data:/.test(m.getAttribute("content"))) {
- let url = m.getAttribute("content").replace(/.*?(?=data:)/, "");
+ 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();
}