diff --git a/extension/detector.html b/extension/detector.html index 6a46b65..c7f93eb 100644 --- a/extension/detector.html +++ b/extension/detector.html @@ -19,11 +19,14 @@ string += "Dein Browser ist mit der Firefox XUL Extension kompatibel die du einfach hier installieren kannst."; } else if (major < 48) { string += "Dein Browser ist mit der Firefox XUL Extension kompatibel, aber erlaubt standartmäßig keine unsigned extensions. Zur Installation musst du:
  1. In about:config die Preference xpinstall.signatures.required auf false setzen
  2. Die extension hier installieren
"; - } else if (major < 56) { + } else if (major < 57) { string += "

ESR, Nightly, Developer Edition, Unbranded

Dein Browser ist mit der Firefox XUL Extension kompatibel, aber erlaubt standartmäßig keine unsigned extensions. Zur Installation musst du:
  1. In about:config die Preference xpinstall.signatures.required auf false setzen
  2. Die extension hier installieren
"; string += "

Release, Beta

Achtung:
Bei dieser Installationsmethode wird der Browser permanent modifiziert (Die Extension kann aber wieder deinstalliert werden)

Dein Browser ist mit der Firefox XUL Extension kompatibel, aber erlaubt eigentlich unter keinen Umständen unsigned extensions. Zur Installation musst du:
  1. In about:config die Preference xpinstall.signatures.required auf false setzen
  2. Die Befator Inc Exploit Locale hier installieren
  3. Auf die Seite chrome://befatorlocale/content/install.xul gehen
  4. Den Browser neustarten
  5. Die extension hier installieren
"; + } else if (major < 58) { + string += "

ESR, Nightly, Developer Edition, Unbranded

Dein Browser ist mit der Firefox XUL Extension kompatibel, aber erlaubt standartmäßig keine unsigned extensions und auch nur Web Extensions. Zur Installation musst du:
  1. In about:config die Preference xpinstall.signatures.required auf false und extensions.legacy.enabled auf true setzen
  2. Die extension hier installieren
"; + string += "

Release, Beta

Achtung:
Bei dieser Installationsmethode wird der Browser permanent modifiziert (Die Extension kann aber wieder deinstalliert werden)

Dein Browser ist mit der Firefox XUL Extension kompatibel, aber erlaubt eigentlich unter keinen Umständen unsigned extensions oder nicht Web Extensions. Zur Installation musst du:
  1. In about:config die Preference xpinstall.signatures.required auf false und extensions.legacy.enabled auf true setzen
  2. Die Befator Inc Exploit Locale hier installieren
  3. Auf die Seite chrome://befatorlocale/content/install.xul gehen
  4. Den Browser neustarten
  5. Die extension hier installieren
"; } else { - string += "Die Firefox XUL Extension unterstützt höchstens Firefox 56."; + string += "Die Firefox XUL Extension unterstützt höchstens Firefox 57."; } } string += "

"; diff --git a/extension/xul/modules/main.jsm b/extension/xul/modules/main.jsm index d0eb84d..b8bc340 100644 --- a/extension/xul/modules/main.jsm +++ b/extension/xul/modules/main.jsm @@ -18,7 +18,7 @@ function onBefatorWindow(window) { var windowElement = window.document.getElementById("main-window"); windowElement.setAttribute("titlemodifier", windowElement.getAttribute("titlemodifier") + " (Befator Inc. Secure-Web)") //window.document.children[0].append("

Befator Inc grüßt Sie

"); - if (window.document.getElementById("search-container") != null) {//null? -> 57 + if (window.document.getElementById("search-container") != null) {//!null -> 56 window.document.getElementById("search-container").setAttribute("style", "display: none;"); } window.document.getElementById("urlbar").setAttribute("placeholder", "Aus Sicherheitsgründen sind nur geprüfte Seiten erlaubt"); @@ -176,21 +176,27 @@ function onBefatorWindow(window) { bookmarksFixer(); var panelFixer2 = function() { - if (window.document.getElementById("appMenu-library-pocket-button") == null && window.document.getElementById("privatebrowsing-button") == null) { + if (window.document.getElementById("privatebrowsing-button") == null) {//!null -> 56 window.setTimeout(panelFixer2, 2000); return; } - if (window.document.getElementById("appMenu-library-pocket-button") != null) {//null -> 56 - window.document.getElementById("appMenu-library-pocket-button").setAttribute("disabled", "true"); - window.document.getElementById("appMenu-library-remotetabs-button").setAttribute("disabled", "true"); - window.document.getElementById("pocket-button-box").remove(); - window.document.getElementById("pageActionButton").remove(); - } else { - window.document.getElementById("privatebrowsing-button").setAttribute("disabled", "true"); - } + window.document.getElementById("privatebrowsing-button").setAttribute("disabled", "true"); } panelFixer2(); + var panelFixer3 = function() { + if (window.document.getElementById("appMenu-library-pocket-button") == null) {//null? -> 56 + window.setTimeout(panelFixer3, 2000); + return; + } + window.document.getElementById("appMenu-library-pocket-button").setAttribute("disabled", "true"); + window.document.getElementById("appMenu-library-remotetabs-button").setAttribute("disabled", "true"); + window.document.getElementById("appMenu-library-screenshots").setAttribute("disabled", "true"); + window.document.getElementById("pocket-button-box").remove(); + window.document.getElementById("pageActionButton").remove(); + } + panelFixer3(); + if (window.document.getElementById("addon-bar") == null) {//undefined -> 3.6 if (window.document.getElementById("privateBrowsingItem") != null) {//null -> 3.0 var panelFixer3 = function() { diff --git a/extension/xul_language/content/init.js b/extension/xul_language/content/init.js index b006254..1da7378 100644 --- a/extension/xul_language/content/init.js +++ b/extension/xul_language/content/init.js @@ -1,12 +1,11 @@ Components.utils.import('resource://gre/modules/Services.jsm').Services; Components.utils.import("resource://gre/modules/FileUtils.jsm"); Components.utils.import("resource://gre/modules/NetUtil.jsm"); +Components.utils.import("resource://gre/modules/AppConstants.jsm"); let installDir = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("CurProcD", Components.interfaces.nsIFile).parent; let omniJar = installDir.clone(); omniJar.append("omni.ja"); -let jsmFile = installDir.clone(); -jsmFile.append("AddonConstants.jsm"); let exeFile = installDir.clone(); exeFile.append("7z.exe"); let dllFile = installDir.clone(); @@ -18,19 +17,51 @@ let zipWriter = Components.Constructor("@mozilla.org/zipwriter;1", "nsIZipWriter let zipReader = Components.Constructor("@mozilla.org/libjar/zip-reader;1", "nsIZipReader"); let reader = new zipReader(); reader.open(omniJar); -let stream = reader.getInputStream("modules/addons/AddonConstants.jsm"); + +let constantsFile = "modules/addons/AddonConstants.jsm"; +if (!reader.hasEntry(constantsFile)) { + constantsFile = "modules/AppConstants.jsm"; +} +let winConstantsFile = constantsFile; +let constantsFileName = constantsFile; +while (winConstantsFile.indexOf("/") != -1) { + constantsFileName = winConstantsFile.substr(winConstantsFile.indexOf("/") + 1); + winConstantsFile = winConstantsFile.replace("/", "\\"); +} +let jsmFile = installDir.clone(); +jsmFile.append(constantsFileName); + +let stream = reader.getInputStream(constantsFile); let data = NetUtil.readInputStreamToString(stream, stream.available()); stream.close(); reader.close(); -data = data.slice(0, data.lastIndexOf("value: true")) + "value: false" + data.slice(data.lastIndexOf("value: true") + "value: true".length) +if (constantsFile == "modules/addons/AddonConstants.jsm") { + data = data.slice(0, data.lastIndexOf("value: true")) + "value: false" + data.slice(data.lastIndexOf("value: true") + "value: true".length); +} else { + function replaceConstant(name, inverted) { + let constantI = data.indexOf(name); + if (constantI != -1 && (inverted ? !AppConstants[name] : AppConstants[name])) { + let split = data.substr(constantI); + let trueI = split.indexOf(inverted ? "false" : "true"); + data = data.substr(0, constantI + trueI) + (inverted ? "true" : "false") + split.substr(trueI + (inverted ? 5 : 4)); + } + } + + replaceConstant("MOZ_REQUIRE_SIGNING", false); + replaceConstant("MOZ_ALLOW_LEGACY_EXTENSIONS", true); +} let fileStream = FileUtils.openAtomicFileOutputStream(jsmFile); fileStream.write(data, data.length); FileUtils.closeAtomicFileOutputStream(fileStream); fileStream = FileUtils.openAtomicFileOutputStream(batFile); -let batContents = "7z x -otemp omni.ja || del temp\\jsloader\\resource\\gre\\modules\\addons\\AddonConstants.jsm && del temp\\modules\\addons\\AddonConstants.jsm && move AddonConstants.jsm temp\\modules\\addons\\AddonConstants.jsm && cd temp && ..\\7z a omni.jar * && move omni.jar ..\\omni.jar && cd .. && del /S /Q 7z.exe 7z.dll temp install.bat && del omni.ja && move omni.jar omni.ja"; +let jsloaderDelete = "del temp\\jsloader\\resource\\gre\\" + winConstantsFile + " &&"; +if (constantsFile != "modules/addons/AddonConstants.jsm") { + jsloaderDelete = ""; +} +let batContents = "7z x -otemp omni.ja & " + jsloaderDelete + " del temp\\" + winConstantsFile + " && move " + constantsFileName + " temp\\" + winConstantsFile + " && cd temp && ..\\7z a omni.jar * && move omni.jar ..\\omni.jar && cd .. && del /S /Q 7z.exe 7z.dll temp install.bat && del omni.ja && move omni.jar omni.ja"; fileStream.write(batContents, batContents.length); FileUtils.closeAtomicFileOutputStream(fileStream); diff --git a/extension/xul_language/install.rdf b/extension/xul_language/install.rdf index 7472ca6..cc6fdb2 100644 --- a/extension/xul_language/install.rdf +++ b/extension/xul_language/install.rdf @@ -13,7 +13,7 @@ {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 48 - 56.* + 57.*