Răsfoiți Sursa

defined a fallback function for console.warn (#260)

Former-commit-id: 2e5f54eb2424f152cc578797532c4c409c0ebde5
Gildas 6 ani în urmă
părinte
comite
06233134f9

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

@@ -56,7 +56,7 @@
 	const requestAnimationFrame = window.requestAnimationFrame;
 	const cancelAnimationFrame = window.cancelAnimationFrame;
 	const console = window.console;
-	const warn = console.warn;
+	const warn = (console && console.warn) || (() => { });
 
 	const observers = new Map();
 	const observedElements = new Map();

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

@@ -35,7 +35,7 @@
 	const addEventListener = window.addEventListener;
 	const pushState = history.pushState;
 	const console = window.console;
-	const warn = console.warn;
+	const warn = (console && console.warn) || (() => { });
 
 	let warningDisplayed;
 	history.pushState = function (state, title, url) {