Explorar o código

fixed issue #219

Former-commit-id: 4ec8ce27b5e73934f1ee496cb979cfc8640a7e73
Gildas %!s(int64=6) %!d(string=hai) anos
pai
achega
37c08c461c
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      lib/hooks/content/content-hooks-web.js

+ 5 - 1
lib/hooks/content/content-hooks-web.js

@@ -32,7 +32,11 @@
 			warningDisplayed = true;
 			console.warn("SingleFile is hooking the history.pushState API to detect navigation."); // eslint-disable-line no-console		
 		}
-		dispatchEvent(new CustomEvent("single-file-push-state", { detail: { state, title, url } }));
+		try {
+			dispatchEvent(new CustomEvent("single-file-push-state", { detail: { state, title, url } }));
+		} catch (error) {
+			// ignored
+		}
 		pushState.call(history, state, title, url);
 	};
 	history.pushState.toString = function () { return "function pushState() { [native code]"; };