Skip to content

Commit

Permalink
Fixed URL matching regexp (thanks insertscript).
Browse files Browse the repository at this point in the history
  • Loading branch information
hackademix committed Mar 21, 2020
1 parent e1cf2bb commit 8b3a36b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/content/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 8b3a36b

Please sign in to comment.