Browse Source

fixed issue with environment where "browser" is undefined

Former-commit-id: 9ccf21d08af094870ba42b074e49ccd592191ef6
Gildas 6 years ago
parent
commit
4bdfb44423
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/frame-tree/content/content-frame-tree.js

+ 1 - 1
lib/frame-tree/content/content-frame-tree.js

@@ -66,7 +66,7 @@ this.singlefile.lib.frameTree.content.frames = this.singlefile.lib.frameTree.con
 				initRequest(message);
 			} else if (message.method == CLEANUP_REQUEST_MESSAGE) {
 				cleanupRequest(message);
-			} else if (!browser.runtime && message.method == INIT_RESPONSE_MESSAGE) {
+			} else if ((!this.browser || !browser.runtime) && message.method == INIT_RESPONSE_MESSAGE) {
 				const port = event.ports[0];
 				port.onmessage = event => initResponse(event.data);
 			}