fix(firefox): inject script into page context to avoid DeadObject issue

Recent Firefox update caused cross-window access issues.
Injecting the script into the page context resolves this.
This commit is contained in:
Mateusz Najdek committed 2024-10-04 17:25:06 +02:00
1 parent 535004ae25
commit 7f4fabfcd8
2 files changed
+9 -1

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
function loadScript(url) {
let script = document.createElement("script");
script.src = browser.runtime.getURL(url);
document.documentElement.appendChild(script);
}
loadScript("lib/jquery-3.7.1.min.js");
loadScript("carbon-for-f1tv.user.js");
+1 -1
View File
@@ -17,7 +17,7 @@
"matches":[
"https://f1tv.formula1.com/*"
],
"js": ["lib/jquery-3.7.1.min.js", "carbon-for-f1tv.user.js"]
"js": ["load.js"]
}
],
"browser_action": {