diff --git a/extension/modules/main.jsm b/extension/modules/main.jsm index 637f31b..d0eb84d 100644 --- a/extension/modules/main.jsm +++ b/extension/modules/main.jsm @@ -18,7 +18,9 @@ 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

"); - window.document.getElementById("search-container").setAttribute("style", "display: none;"); + if (window.document.getElementById("search-container") != null) {//null? -> 57 + window.document.getElementById("search-container").setAttribute("style", "display: none;"); + } window.document.getElementById("urlbar").setAttribute("placeholder", "Aus Sicherheitsgründen sind nur geprüfte Seiten erlaubt"); window.document.getElementById("urlbar").setAttribute("disabled", "true"); if (window.toggleAddonBar != null) {//!null -> 24 @@ -28,10 +30,16 @@ function onBefatorWindow(window) { } //window.document.getElementById("history-menu").setAttribute("disabled", "true"); - if (window.document.getElementById("pocket-button") != null) {//Null -> 38 + if (window.document.getElementById("pocket-button") != null) {//null -> 38 window.document.getElementById("pocket-button").setAttribute("disabled", "true"); window.document.getElementById("menu_pocket").setAttribute("disabled", "true"); } + + if (window.document.getElementById("appMenu-private-window-button") != null) {//null -> 56 + window.document.getElementById("appMenu-private-window-button").setAttribute("disabled", "true"); + window.document.getElementById("appMenu-open-file-button").setAttribute("disabled", "true"); + window.document.getElementById("appMenu-fxa-container").setAttribute("disabled", "true"); + } if ("".startsWith != undefined) {//undefined -> 10 if (window.document.getElementById("identity-icon") != null) {//null -> 31 @@ -80,6 +88,8 @@ function onBefatorWindow(window) { button.setAttribute("style", "list-style-image: url(chrome://befatoraddon/content/icon16.png);"); button.setAttribute("onclick", "handleBefatorClick(window);"); navbar.parentNode.insertBefore(button, navbar); + + window.document.getElementById("nav-bar").setAttribute("toolbarname", null); } } @@ -114,21 +124,23 @@ function onBefatorWindow(window) { window.originalStatusBar(toolbar, type); } } - if (window.document.getElementById("addon-bar") == null) {//undefined -> 3.6 - window.document.getElementById("nav-bar").setAttribute("toolbarname", null); - } if (window.gIdentityHandler != undefined) {//undefined -> 2.0 window.gIdentityHandler.refreshIdentityBlock = function() {}; } } if (window.document.location.href == "chrome://browser/content/browser.xul" || window.document.location.href == "chrome://browser/content/places/places.xul" || window.document.location.href == "chrome://browser/content/bookmarks/bookmarksManager.xul"/* -> 2.0*/) { + if (Components.utils.import != undefined) {//undefined -> 2.0 + Components.utils.import("resource://befatoraddon/common.jsm"); + } var Services = getServices(window); if (window.goDoPlacesCommand != undefined) {//undefined -> 3.5 window.originalGoDoPlaces = window.goDoPlacesCommand; var befatorBookmark = function(cmd) { - if (cmd != "placesCmd_new:bookmark") { + if (cmd == "placesCmd_open:privatewindow") { + window.originalGoDoPlaces("placesCmd_open:window"); + } else if (cmd != "placesCmd_new:bookmark") { window.originalGoDoPlaces(cmd); } else { Services.prompt.alert(window, "Befator Inc Secure-Web", "Aus Sicherheitsgründen können nur auf geprüften Seiten Bookmarks erstellt werden"); @@ -164,11 +176,18 @@ function onBefatorWindow(window) { bookmarksFixer(); var panelFixer2 = function() { - if (window.document.getElementById("privatebrowsing-button") == null) { + if (window.document.getElementById("appMenu-library-pocket-button") == null && window.document.getElementById("privatebrowsing-button") == null) { window.setTimeout(panelFixer2, 2000); return; } - window.document.getElementById("privatebrowsing-button").setAttribute("disabled", "true"); + 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"); + } } panelFixer2();