Sfoglia il codice sorgente

Make test more strict

Gildas 5 anni fa
parent
commit
d9df7f0533

+ 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);