Răsfoiți Sursa

fallback on error

Gildas 4 ani în urmă
părinte
comite
dabac919ba

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

@@ -48,7 +48,11 @@ if (browser && browser.runtime && browser.runtime.onMessage && browser.runtime.o
 			const timeoutData = timeouts.get(message.type);
 			if (timeoutData) {
 				timeouts.delete(message.type);
-				timeoutData.callback();
+				try {
+					timeoutData.callback();
+				} catch (error) {
+					clearRegularTimeout(message.type);
+				}
 			}
 		}
 	});