Skip to content

Commit 37928bd

Browse files
committed
Completed fix for quoted URLs confusing meta refresh emulation.
1 parent 909e960 commit 37928bd

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/content/onScriptDisabled.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ function onScriptDisabled() {
1010
let content = meta.getAttribute("content");
1111
if (content) {
1212
let [secs, url] = content.split(/\s*;\s*url\s*=\s*/i);
13+
let urlObj;
1314
if (url) {
1415
try {
15-
let urlObj = new URL(url.replace(/^(['"]?)(.+?)\1$/, '$2'));
16+
urlObj = new URL(url.replace(/^(['"]?)(.+?)\1$/, '$2'));
1617
if (!/^https?:/.test(urlObj.protocol)) {
1718
continue;
1819
}
1920
} catch (e) {
21+
continue;
2022
}
21-
window.setTimeout(() => location.href = url, (parseInt(secs) || 0) * 1000);
23+
window.setTimeout(() => location.href = urlObj, (parseInt(secs) || 0) * 1000);
2224
}
2325
}
2426
}

0 commit comments

Comments
 (0)