From f145e625e4ab2118c811ef4403c0939a1d30b5a7 Mon Sep 17 00:00:00 2001 From: hackademix Date: Mon, 1 Apr 2019 19:12:20 +0200 Subject: Limit wrappedJSObject usages to compatible browsers. --- src/content/ftp.js | 2 +- src/content/onScriptDisabled.js | 2 +- src/content/staticNS.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/content') diff --git a/src/content/ftp.js b/src/content/ftp.js index 73ef5e8..cb29f13 100644 --- a/src/content/ftp.js +++ b/src/content/ftp.js @@ -1,4 +1,4 @@ -(() => { +if (UA.isMozilla) (() => { // see https://dxr.mozilla.org/mozilla-central/rev/d03b538b6b417ba892d0a92fd693945b741246e1/netwerk/streamconv/converters/nsIndexedToHTML.cpp#381 'use strict'; var gTable, gOrderBy, gTBody, gRows, gUI_showHidden; diff --git a/src/content/onScriptDisabled.js b/src/content/onScriptDisabled.js index c0d5899..6083466 100644 --- a/src/content/onScriptDisabled.js +++ b/src/content/onScriptDisabled.js @@ -15,7 +15,7 @@ function onScriptDisabled() { if (refresh) { let html = document.documentElement.outerHTML; window.addEventListener("load", e => { - let document = window.wrappedJSObject.document; + let document = window.wrappedJSObject ? window.wrappedJSObject.document : window.document; document.open(); document.write(html); document.close(); diff --git a/src/content/staticNS.js b/src/content/staticNS.js index e169087..3561162 100644 --- a/src/content/staticNS.js +++ b/src/content/staticNS.js @@ -65,7 +65,7 @@ } catch (e) { error(e); } - } else if (window !== window.top) { + } else if (UA.isMozilla && window !== window.top) { // The cookie hack won't work for non-HTTP subframes (issue #48), // or the cookie might have been deleted in a race condition, // so here we try to check the parent -- cgit v1.2.3