|
@@ -21,7 +21,7 @@
|
|
|
* Source.
|
|
* Source.
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
-/* global browser, window, addEventListener, dispatchEvent, CustomEvent, document, HTMLDocument, FileReader, Blob */
|
|
|
|
|
|
|
+/* global browser, window, addEventListener, dispatchEvent, CustomEvent, document, HTMLDocument, FileReader, Blob, getFileContent */
|
|
|
|
|
|
|
|
this.hooksFrame = this.hooksFrame || (() => {
|
|
this.hooksFrame = this.hooksFrame || (() => {
|
|
|
|
|
|
|
@@ -34,7 +34,11 @@ this.hooksFrame = this.hooksFrame || (() => {
|
|
|
|
|
|
|
|
if (document instanceof HTMLDocument) {
|
|
if (document instanceof HTMLDocument) {
|
|
|
let scriptElement = document.createElement("script");
|
|
let scriptElement = document.createElement("script");
|
|
|
- scriptElement.src = browser.runtime.getURL("/lib/hooks/hooks-web.js");
|
|
|
|
|
|
|
+ if (typeof browser !== "undefined" && browser.runtime && browser.runtime.getURL) {
|
|
|
|
|
+ scriptElement.src = browser.runtime.getURL("/lib/hooks/hooks-web.js");
|
|
|
|
|
+ } else if (typeof getFileContent !== "undefined") {
|
|
|
|
|
+ scriptElement.textContent = getFileContent("/lib/hooks/hooks-web.js");
|
|
|
|
|
+ }
|
|
|
(document.documentElement || document).appendChild(scriptElement);
|
|
(document.documentElement || document).appendChild(scriptElement);
|
|
|
scriptElement.remove();
|
|
scriptElement.remove();
|
|
|
scriptElement = document.createElement("script");
|
|
scriptElement = document.createElement("script");
|