Explorar o código

ignore errors when trying to override document.cookie

Gildas %!s(int64=6) %!d(string=hai) anos
pai
achega
0ee9e110bc
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      lib/hooks/hooks-frame.js

+ 4 - 0
lib/hooks/hooks-frame.js

@@ -82,7 +82,11 @@ this.hooksFrame = this.hooksFrame || (() => {
 			document.documentElement.__defineGetter__("clientWidth", () => scrollWidth);
 			screen.__defineGetter__("height", () => scrollHeight);
 			screen.__defineGetter__("width", () => scrollWidth);
+			try {
 			document.__defineGetter__("cookie", () => { throw new Error("document.cookie temporary blocked by SingleFile"); });
+			} catch (error) {
+				// ignored
+			}
 			if (!window._singleFile_getBoundingClientRect) {
 				window._singleFile_getBoundingClientRect = Element.prototype.getBoundingClientRect;
 				Element.prototype.getBoundingClientRect = function () {