Просмотр исходного кода

refactored the test of this.browser

Gildas 6 лет назад
Родитель
Сommit
5306d4aa18
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      lib/hooks/content/content-hooks-frames.js

+ 1 - 1
lib/hooks/content/content-hooks-frames.js

@@ -34,7 +34,7 @@ this.singlefile.lib.hooks.content.frames = this.singlefile.lib.hooks.content.fra
 
 	if (document instanceof HTMLDocument) {
 		let scriptElement = document.createElement("script");
-		if (typeof browser !== "undefined" && browser.runtime && browser.runtime.getURL) {
+		if (this.browser && browser.runtime && browser.runtime.getURL) {
 			scriptElement.src = browser.runtime.getURL("/lib/hooks/content/content-hooks-web.js");
 		} else if (this.singlefile.lib.getFileContent) {
 			scriptElement.textContent = this.singlefile.lib.getFileContent("/lib/hooks/content/content-hooks-web.js");