Bladeren bron

fixed issue #219

Former-commit-id: 4ec8ce27b5e73934f1ee496cb979cfc8640a7e73
Gildas 6 jaren geleden
bovenliggende
commit
37c08c461c
1 gewijzigde bestanden met toevoegingen van 5 en 1 verwijderingen
  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]"; };