use documentUrl, not originalUrl, still fallback to url. - firefox-fix-web - Firefox extension: fix web
(HTM) git clone git://git.codemadness.org/firefox-fix-web
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 4962c0571299f0ed3af45630de874b3e333fc543
(DIR) parent deee659665bec6079694d48833f97070bca5f8f7
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Mon, 23 Mar 2020 13:29:17 +0100
use documentUrl, not originalUrl, still fallback to url.
originUrl seems to be the referer. Noticed when a tweet is referenced by a
link.
Diffstat:
M extension/background.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/extension/background.js b/extension/background.js
@@ -1,5 +1,3 @@
-browser.runtime.getBrowserInfo().then(main);
-
function main(info) {
/* get current running Firefox version, to always keep up-to-date */
@@ -35,7 +33,7 @@ function rewriteua(e) {
if (header.name.toLowerCase() !== "user-agent")
continue;
var ua = ua_default;
- var url = e.originUrl || e.url || "";
+ var url = e.documentUrl || e.url || "";
for (var p of patterns) {
var m = p.re.exec(url);
if (m === null)
@@ -60,3 +58,5 @@ chrome.webRequest.onBeforeSendHeaders.addListener(
);
}
+
+browser.runtime.getBrowserInfo().then(main);