瀏覽代碼

Make test more strict

Gildas 5 年之前
父節點
當前提交
d9df7f0533
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/single-file/processors/lazy/content/content-lazy-loader.js

+ 1 - 1
lib/single-file/processors/lazy/content/content-lazy-loader.js

@@ -35,7 +35,7 @@ this.singlefile.lib.processors.lazy.content.loader = this.singlefile.lib.process
 	const removeEventListener = (type, listener, options) => window.removeEventListener(type, listener, options);
 	const timeouts = new Map();
 
-	if (browser && browser.runtime) {
+	if (browser && browser.runtime && browser.runtime.onMessage && browser.runtime.onMessage.addListener) {
 		browser.runtime.onMessage.addListener(message => {
 			if (message.method == "singlefile.lazyTimeout.onTimeout") {
 				const timeoutData = timeouts.get(message.type);