Quellcode durchsuchen

ignore errors when trying to override document.cookie

Gildas vor 6 Jahren
Ursprung
Commit
0ee9e110bc
1 geänderte Dateien mit 4 neuen und 0 gelöschten Zeilen
  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 () {