diff options
37 files changed, 14 insertions, 1237 deletions
diff --git a/app/profile/iceweasel-uxp.js b/app/profile/iceweasel-uxp.js index 92809e1..90c81b4 100644 --- a/app/profile/iceweasel-uxp.js +++ b/app/profile/iceweasel-uxp.js @@ -451,6 +451,11 @@ pref("javascript.options.showInConsole", true); pref("general.warnOnAboutConfig", false); #endif +// TODO: Remove ContextualIdentityPrefs once possible in toolkit (BackgroundPageThumbs.jsm) +pref("privacy.usercontext.about_newtab_segregation.enabled", false); +pref("privacy.userContext.enabled", false); +pref("privacy.userContext.ui.enabled", false); + // This is the pref to control the location bar, change this to true to // force this - this makes the origin of popup windows more obvious to avoid // spoofing. We would rather not do it by default because it affects UE for web @@ -1258,17 +1263,6 @@ pref("privacy.trackingprotection.ui.enabled", true); pref("privacy.trackingprotection.ui.enabled", false); #endif -// Enable Contextual Identity Containers -#ifdef NIGHTLY_BUILD -pref("privacy.userContext.enabled", true); -pref("privacy.userContext.ui.enabled", true); -pref("privacy.usercontext.about_newtab_segregation.enabled", true); -#else -pref("privacy.userContext.enabled", false); -pref("privacy.userContext.ui.enabled", false); -pref("privacy.usercontext.about_newtab_segregation.enabled", false); -#endif - #ifndef RELEASE_OR_BETA // At the moment, autostart.2 is used, while autostart.1 is unused. // We leave it here set to false to reset users' defaults and allow diff --git a/base/content/browser.js b/base/content/browser.js index 035cf2c..ae0e3c1 100755 --- a/base/content/browser.js +++ b/base/content/browser.js @@ -8,7 +8,6 @@ var Cu = Components.utils; var Cc = Components.classes; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://gre/modules/ContextualIdentityService.jsm"); Cu.import("resource://gre/modules/NotificationDB.jsm"); // lazy module getters @@ -3984,51 +3983,6 @@ function openNewUserContextTab(event) } /** - * Updates File Menu User Context UI visibility depending on - * privacy.userContext.enabled pref state. - */ -function updateUserContextUIVisibility() -{ - let menu = document.getElementById("menu_newUserContext"); - menu.hidden = !Services.prefs.getBoolPref("privacy.userContext.enabled"); - if (PrivateBrowsingUtils.isWindowPrivate(window)) { - menu.setAttribute("disabled", "true"); - } -} - -/** - * Updates the User Context UI indicators if the browser is in a non-default context - */ -function updateUserContextUIIndicator() -{ - let hbox = document.getElementById("userContext-icons"); - - let userContextId = gBrowser.selectedBrowser.getAttribute("usercontextid"); - if (!userContextId) { - hbox.setAttribute("data-identity-color", ""); - hbox.hidden = true; - return; - } - - let identity = ContextualIdentityService.getIdentityFromId(userContextId); - if (!identity) { - hbox.setAttribute("data-identity-color", ""); - hbox.hidden = true; - return; - } - - hbox.setAttribute("data-identity-color", identity.color); - - let label = document.getElementById("userContext-label"); - label.setAttribute("value", ContextualIdentityService.getUserContextLabel(userContextId)); - - let indicator = document.getElementById("userContext-indicator"); - indicator.setAttribute("data-identity-icon", identity.icon); - - hbox.hidden = false; -} - -/** * Makes the Character Encoding menu enabled or disabled as appropriate. * To be called when the View menu or the app menu is opened. */ diff --git a/base/content/browser.xul b/base/content/browser.xul index 06e05cc..0e6ea75 100644 --- a/base/content/browser.xul +++ b/base/content/browser.xul @@ -8,7 +8,6 @@ <?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?> <?xml-stylesheet href="chrome://browser/content/places/places.css" type="text/css"?> -<?xml-stylesheet href="chrome://browser/content/usercontext/usercontext.css" type="text/css"?> #ifdef MOZ_DEVTOOLS <?xml-stylesheet href="chrome://devtools/skin/devtools-browser.css" type="text/css"?> #endif @@ -551,12 +550,7 @@ key="key_undoCloseTab" label="&undoCloseTab.label;" observes="History:UndoCloseTab"/> - <menuseparator id="alltabs-popup-separator-1"/> - <menu id="alltabs_containersTab" - label="&newUserContext.label;"> - <menupopup id="alltabs_containersMenuTab" /> - </menu> - <menuseparator id="alltabs-popup-separator-2"/> + <menuseparator id="alltabs-popup-separator"/> </menupopup> </toolbarbutton> diff --git a/base/content/nsContextMenu.js b/base/content/nsContextMenu.js index 7bcd5d9..f7d4a2d 100644 --- a/base/content/nsContextMenu.js +++ b/base/content/nsContextMenu.js @@ -4,7 +4,6 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -Components.utils.import("resource://gre/modules/ContextualIdentityService.jsm"); Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); Components.utils.import("resource://gre/modules/InlineSpellChecker.jsm"); Components.utils.import("resource://gre/modules/LoginManagerContextMenu.jsm"); @@ -104,28 +103,11 @@ nsContextMenu.prototype = { this.onPlainTextLink = true; } - var inContainer = false; - if (gContextMenuContentData.userContextId) { - inContainer = true; - var item = document.getElementById("context-openlinkincontainertab"); - - item.setAttribute("data-usercontextid", gContextMenuContentData.userContextId); - - var label = - ContextualIdentityService.getUserContextLabel(gContextMenuContentData.userContextId); - item.setAttribute("label", - gBrowserBundle.formatStringFromName("userContextOpenLink.label", - [label], 1)); - } - var shouldShow = this.onSaveableLink || isMailtoInternal || this.onPlainTextLink; var isWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(window); - var showContainers = Services.prefs.getBoolPref("privacy.userContext.enabled"); this.showItem("context-openlink", shouldShow && !isWindowPrivate); this.showItem("context-openlinkprivate", shouldShow); - this.showItem("context-openlinkintab", shouldShow && !inContainer); - this.showItem("context-openlinkincontainertab", shouldShow && inContainer); - this.showItem("context-openlinkinusercontext-menu", shouldShow && !isWindowPrivate && showContainers); + this.showItem("context-openlinkintab", shouldShow); this.showItem("context-openlinkincurrent", this.onPlainTextLink); this.showItem("context-sep-open", shouldShow); }, @@ -918,13 +900,6 @@ nsContextMenu.prototype = { params[p] = extra[p]; } - // If we want to change userContextId, we must be sure that we don't - // propagate the referrer. - if ("userContextId" in params && - params.userContextId != gContextMenuContentData.userContextId) { - params.noReferrer = true; - } - return params; }, @@ -942,7 +917,7 @@ nsContextMenu.prototype = { }, // Open linked-to URL in a new tab. - openLinkInTab: function(event) { + openLinkInTab: function() { urlSecurityCheck(this.linkURL, this.principal); let referrerURI = gContextMenuContentData.documentURIObject; @@ -963,7 +938,6 @@ nsContextMenu.prototype = { let params = { allowMixedContent: persistAllowMixedContentInChildTab, - userContextId: parseInt(event.target.getAttribute('data-usercontextid')), }; openLinkIn(this.linkURL, "tab", this._openLinkInParameters(params)); @@ -1739,8 +1713,4 @@ nsContextMenu.prototype = { menuItem.label = menuLabel; menuItem.accessKey = gNavigatorBundle.getString("contextMenuSearch.accesskey"); }, - createContainerMenu: function(aEvent) { - return createUserContextMenu(aEvent, true, - gContextMenuContentData.userContextId); - }, }; diff --git a/base/content/tabbrowser.xml b/base/content/tabbrowser.xml index 76ea5d1..44b8acb 100644 --- a/base/content/tabbrowser.xml +++ b/base/content/tabbrowser.xml @@ -1230,7 +1230,6 @@ this._adjustFocusAfterTabSwitch(this.mCurrentTab); } - updateUserContextUIIndicator(); gIdentityHandler.updateSharingIndicator(); this.tabContainer._setPositionalAttributes(); @@ -2144,11 +2143,6 @@ t.setAttribute("label", aURI); } - if (aUserContextId) { - t.setAttribute("usercontextid", aUserContextId); - ContextualIdentityService.setTabStyle(t); - } - t.setAttribute("crop", "end"); t.setAttribute("onerror", "this.removeAttribute('image');"); t.className = "tabbrowser-tab"; @@ -4638,16 +4632,6 @@ } case "Browser:WindowCreated": { let tab = this.getTabForBrowser(browser); - if (tab && data.userContextId) { - ContextualIdentityService.telemetry(data.userContextId); - tab.setUserContextId(data.userContextId); - } - - // We don't want to update the container icon and identifier if - // this is not the selected browser. - if (browser == gBrowser.selectedBrowser) { - updateUserContextUIIndicator(); - } break; } @@ -5233,7 +5217,7 @@ </xul:arrowscrollbox> </content> - <implementation implements="nsIDOMEventListener, nsIObserver"> + <implementation implements="nsIDOMEventListener"> <constructor> <![CDATA[ this.mTabClipWidth = Services.prefs.getIntPref("browser.tabs.tabClipWidth"); @@ -5252,17 +5236,9 @@ this._tabAnimationLoggingEnabled = false; } this._browserNewtabpageEnabled = Services.prefs.getBoolPref("browser.newtabpage.enabled"); - this.observe(null, "nsPref:changed", "privacy.userContext.enabled"); - Services.prefs.addObserver("privacy.userContext.enabled", this, false); ]]> </constructor> - <destructor> - <![CDATA[ - Services.prefs.removeObserver("privacy.userContext.enabled", this); - ]]> - </destructor> - <field name="tabbrowser" readonly="true"> document.getElementById(this.getAttribute("tabbrowser")); </field> @@ -5288,55 +5264,6 @@ <field name="_afterHoveredTab">null</field> <field name="_hoveredTab">null</field> - <method name="observe"> - <parameter name="aSubject"/> - <parameter name="aTopic"/> - <parameter name="aData"/> - <body><![CDATA[ - switch (aTopic) { - case "nsPref:changed": - // This is the only pref observed. - let containersEnabled = Services.prefs.getBoolPref("privacy.userContext.enabled"); - - const newTab = document.getElementById("new-tab-button"); - const newTab2 = document.getAnonymousElementByAttribute(this, "anonid", "tabs-newtab-button") - - if (containersEnabled) { - for (let parent of [newTab, newTab2]) { - if (!parent) - continue; - let popup = document.createElementNS( - "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", - "menupopup"); - if (parent.id) { - popup.id = "newtab-popup"; - } else { - popup.setAttribute("anonid", "newtab-popup"); - } - popup.className = "new-tab-popup"; - popup.setAttribute("position", "after_end"); - parent.appendChild(popup); - - gClickAndHoldListenersOnElement.add(parent); - parent.setAttribute("type", "menu"); - } - } else { - for (let parent of [newTab, newTab2]) { - if (!parent) - continue; - gClickAndHoldListenersOnElement.remove(parent); - parent.removeAttribute("type"); - if (!parent.firstChild) - continue; - parent.firstChild.remove(); - } - } - - break; - } - ]]></body> - </method> - <property name="_isCustomizing" readonly="true"> <getter> let root = document.documentElement; @@ -6839,27 +6766,6 @@ ]]> </body> </method> - - <method name="setUserContextId"> - <parameter name="aUserContextId"/> - <body> - <![CDATA[ - if (aUserContextId) { - if (this.linkedBrowser) { - this.linkedBrowser.setAttribute("usercontextid", aUserContextId); - } - this.setAttribute("usercontextid", aUserContextId); - } else { - if (this.linkedBrowser) { - this.linkedBrowser.removeAttribute("usercontextid"); - } - this.removeAttribute("usercontextid"); - } - - ContextualIdentityService.setTabStyle(this); - ]]> - </body> - </method> </implementation> <handlers> @@ -7036,30 +6942,9 @@ <handlers> <handler event="popupshowing"> <![CDATA[ - if (event.target.getAttribute("id") == "alltabs_containersMenuTab") { - createUserContextMenu(event); - return; - } - - let containersEnabled = Services.prefs.getBoolPref("privacy.userContext.enabled"); - - if (event.target.getAttribute("anonid") == "newtab-popup" || - event.target.id == "newtab-popup") { - createUserContextMenu(event); - } else { - document.getElementById("alltabs-popup-separator-1").hidden = !containersEnabled; - let containersTab = document.getElementById("alltabs_containersTab"); - - containersTab.hidden = !containersEnabled; - if (PrivateBrowsingUtils.isWindowPrivate(window)) { - containersTab.setAttribute("disabled", "true"); - } - document.getElementById("alltabs_undoCloseTab").disabled = SessionStore.getClosedTabCount(window) == 0; - var tabcontainer = gBrowser.tabContainer; - // Listen for changes in the tab bar. tabcontainer.addEventListener("TabAttrModified", this, false); tabcontainer.addEventListener("TabClose", this, false); @@ -7076,10 +6961,6 @@ <handler event="popuphidden"> <![CDATA[ - if (event.target.getAttribute("id") == "alltabs_containersMenuTab") { - return; - } - // clear out the menu popup and remove the listeners for (let i = this.childNodes.length - 1; i > 0; i--) { let menuItem = this.childNodes[i]; @@ -7087,9 +6968,6 @@ menuItem.tab.mCorrespondingMenuitem = null; this.removeChild(menuItem); } - if (menuItem.hasAttribute("usercontextid")) { - this.removeChild(menuItem); - } } var tabcontainer = gBrowser.tabContainer; tabcontainer.mTabstrip.removeEventListener("scroll", this, false); diff --git a/base/content/utilityOverlay.js b/base/content/utilityOverlay.js index 38ca82f..c8d8521 100644 --- a/base/content/utilityOverlay.js +++ b/base/content/utilityOverlay.js @@ -5,7 +5,6 @@ // Services = object with smart getters for common XPCOM services Components.utils.import("resource://gre/modules/AppConstants.jsm"); -Components.utils.import("resource://gre/modules/ContextualIdentityService.jsm"); Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); @@ -176,7 +175,6 @@ function whereToOpenLink( e, ignoreButton, ignoreAlt ) * skipTabAnimation (boolean) * allowPinnedTabHostChange (boolean) * allowPopups (boolean) - * userContextId (unsigned int) */ function openUILinkIn(url, where, aAllowThirdPartyFixup, aPostData, aReferrerURI) { var params; @@ -222,7 +220,6 @@ function openLinkIn(url, where, params) { var aAllowPinnedTabHostChange = !!params.allowPinnedTabHostChange; var aNoReferrer = params.noReferrer; var aAllowPopups = !!params.allowPopups; - var aUserContextId = params.userContextId; var aIndicateErrorPageLoad = params.indicateErrorPageLoad; var aPrincipal = params.originPrincipal; var aTriggeringPrincipal = params.triggeringPrincipal; @@ -268,7 +265,6 @@ function openLinkIn(url, where, params) { function useOAForPrincipal(principal) { if (principal && principal.isCodebasePrincipal) { let attrs = { - userContextId: aUserContextId, privateBrowsingId: aIsPrivate || (w && PrivateBrowsingUtils.isWindowPrivate(w)), }; return Services.scriptSecurityManager.createCodebasePrincipal(principal.URI, attrs); @@ -315,17 +311,12 @@ function openLinkIn(url, where, params) { createInstance(Ci.nsISupportsPRUint32); referrerPolicySupports.data = aReferrerPolicy; - var userContextIdSupports = Cc["@mozilla.org/supports-PRUint32;1"]. - createInstance(Ci.nsISupportsPRUint32); - userContextIdSupports.data = aUserContextId; - sa.appendElement(wuri, /* weak =*/ false); sa.appendElement(charset, /* weak =*/ false); sa.appendElement(referrerURISupports, /* weak =*/ false); sa.appendElement(aPostData, /* weak =*/ false); sa.appendElement(allowThirdPartyFixupSupports, /* weak =*/ false); sa.appendElement(referrerPolicySupports, /* weak =*/ false); - sa.appendElement(userContextIdSupports, /* weak =*/ false); sa.appendElement(aPrincipal, /* weak =*/ false); sa.appendElement(aTriggeringPrincipal, /* weak =*/ false); @@ -418,8 +409,7 @@ function openLinkIn(url, where, params) { flags: flags, referrerURI: aNoReferrer ? null : aReferrerURI, referrerPolicy: aReferrerPolicy, - postData: aPostData, - userContextId: aUserContextId + postData: aPostData }); browserUsedForLoad = aCurrentBrowser; break; @@ -438,7 +428,6 @@ function openLinkIn(url, where, params) { skipAnimation: aSkipTabAnimation, allowMixedContent: aAllowMixedContent, noReferrer: aNoReferrer, - userContextId: aUserContextId, originPrincipal: aPrincipal, triggeringPrincipal: aTriggeringPrincipal, }); @@ -482,74 +471,6 @@ function checkForMiddleClick(node, event) { } } -// Populate a menu with user-context menu items. This method should be called -// by onpopupshowing passing the event as first argument. -function createUserContextMenu(event, isContextMenu = false, excludeUserContextId = 0) { - while (event.target.hasChildNodes()) { - event.target.removeChild(event.target.firstChild); - } - - let bundle = document.getElementById("bundle_browser"); - let docfrag = document.createDocumentFragment(); - - // If we are excluding a userContextId, we want to add a 'no-container' item. - if (excludeUserContextId) { - let menuitem = document.createElement("menuitem"); - menuitem.setAttribute("data-usercontextid", "0"); - menuitem.setAttribute("label", bundle.getString("userContextNone.label")); - menuitem.setAttribute("accesskey", bundle.getString("userContextNone.accesskey")); - - // We don't set an oncommand/command attribute because if we have - // to exclude a userContextId we are generating the contextMenu and - // isContextMenu will be true. - - docfrag.appendChild(menuitem); - - let menuseparator = document.createElement("menuseparator"); - docfrag.appendChild(menuseparator); - } - - ContextualIdentityService.getIdentities().forEach(identity => { - if (identity.userContextId == excludeUserContextId) { - return; - } - - let menuitem = document.createElement("menuitem"); - menuitem.setAttribute("data-usercontextid", identity.userContextId); - menuitem.setAttribute("label", ContextualIdentityService.getUserContextLabel(identity.userContextId)); - - if (identity.accessKey) { - menuitem.setAttribute("accesskey", bundle.getString(identity.accessKey)); - } - - menuitem.classList.add("menuitem-iconic"); - menuitem.setAttribute("data-identity-color", identity.color); - - if (!isContextMenu) { - menuitem.setAttribute("command", "Browser:NewUserContextTab"); - } - - menuitem.setAttribute("data-identity-icon", identity.icon); - - docfrag.appendChild(menuitem); - }); - - if (!isContextMenu) { - docfrag.appendChild(document.createElement("menuseparator")); - - let menuitem = document.createElement("menuitem"); - menuitem.setAttribute("label", - bundle.getString("userContext.aboutPage.label")); - menuitem.setAttribute("accesskey", - bundle.getString("userContext.aboutPage.accesskey")); - menuitem.setAttribute("command", "Browser:OpenAboutContainers"); - docfrag.appendChild(menuitem); - } - - event.target.appendChild(docfrag); - return true; -} - // Closes all popups that are ancestors of the node. function closeMenus(node) { diff --git a/components/contextualidentity/content/usercontext.css b/components/contextualidentity/content/usercontext.css deleted file mode 100644 index 728275d..0000000 --- a/components/contextualidentity/content/usercontext.css +++ /dev/null @@ -1,91 +0,0 @@ -[data-identity-color="blue"] { - --identity-tab-color: #0996f8; - --identity-icon-color: #00a7e0; -} - -[data-identity-color="turquoise"] { - --identity-tab-color: #01bdad; - --identity-icon-color: #01bdad; -} - -[data-identity-color="green"] { - --identity-tab-color: #57bd35; - --identity-icon-color: #7dc14c; -} - -[data-identity-color="yellow"] { - --identity-tab-color: #ffcb00; - --identity-icon-color: #ffcb00; -} - -[data-identity-color="orange"] { - --identity-tab-color: #ff9216; - --identity-icon-color: #ff9216; -} - -[data-identity-color="red"] { - --identity-tab-color: #d92215; - --identity-icon-color: #d92215; -} - -[data-identity-color="pink"] { - --identity-tab-color: #ea385e; - --identity-icon-color: #ee5195; -} - -[data-identity-color="purple"] { - --identity-tab-color: #7a2f7a; - --identity-icon-color: #7a2f7a; -} - -[data-identity-icon="fingerprint"] { - --identity-icon: url("chrome://browser/content/usercontext.svg#fingerprint"); -} - -[data-identity-icon="briefcase"] { - --identity-icon: url("chrome://browser/content/usercontext.svg#briefcase"); -} - -[data-identity-icon="dollar"] { - --identity-icon: url("chrome://browser/content/usercontext.svg#dollar"); -} - -[data-identity-icon="cart"] { - --identity-icon: url("chrome://browser/content/usercontext.svg#cart"); -} - -[data-identity-icon="circle"] { - --identity-icon: url("chrome://browser/content/usercontext.svg#circle"); -} - -#userContext-indicator { - height: 16px; - width: 16px; -} - -#userContext-label { - margin-inline-end: 3px; - color: var(--identity-tab-color); -} - -#userContext-icons { - -moz-box-align: center; -} - -.tabbrowser-tab[usercontextid] { - background-image: linear-gradient(to right, transparent 20%, var(--identity-tab-color) 30%, var(--identity-tab-color) 70%, transparent 80%); - background-size: auto 2px; - background-repeat: no-repeat; -} - -.userContext-icon, -.menuitem-iconic[data-usercontextid] > .menu-iconic-left > .menu-iconic-icon, -.subviewbutton[usercontextid] > .toolbarbutton-icon, -#userContext-indicator { - background-image: var(--identity-icon); - filter: url(chrome://browser/skin/filters.svg#fill); - fill: var(--identity-icon-color); - background-size: contain; - background-repeat: no-repeat; - background-position: center center; -} diff --git a/components/contextualidentity/jar.mn b/components/contextualidentity/jar.mn deleted file mode 100644 index 8482459..0000000 --- a/components/contextualidentity/jar.mn +++ /dev/null @@ -1,6 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -browser.jar: - content/browser/usercontext/usercontext.css (content/usercontext.css) diff --git a/components/contextualidentity/moz.build b/components/contextualidentity/moz.build deleted file mode 100644 index aac3a83..0000000 --- a/components/contextualidentity/moz.build +++ /dev/null @@ -1,7 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -JAR_MANIFESTS += ['jar.mn'] diff --git a/components/customizableui/CustomizableWidgets.jsm b/components/customizableui/CustomizableWidgets.jsm index 4031499..abaed22 100644 --- a/components/customizableui/CustomizableWidgets.jsm +++ b/components/customizableui/CustomizableWidgets.jsm @@ -25,8 +25,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", "resource://gre/modules/PrivateBrowsingUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "SyncedTabs", "resource://services-sync/SyncedTabs.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService", - "resource://gre/modules/ContextualIdentityService.jsm"); XPCOMUtils.defineLazyGetter(this, "CharsetBundle", function() { const kCharsetBundle = "chrome://global/locale/charsetMenu.properties"; @@ -1016,89 +1014,6 @@ const CustomizableWidgets = [ let win = aEvent.view; win.MailIntegration.sendLinkForBrowser(win.gBrowser.selectedBrowser) } - }, { - id: "containers-panelmenu", - type: "view", - viewId: "PanelUI-containers", - hasObserver: false, - onCreated: function(aNode) { - let doc = aNode.ownerDocument; - let win = doc.defaultView; - let items = doc.getElementById("PanelUI-containersItems"); - - let onItemCommand = function (aEvent) { - let item = aEvent.target; - if (item.hasAttribute("usercontextid")) { - let userContextId = parseInt(item.getAttribute("usercontextid")); - win.openUILinkIn(win.BROWSER_NEW_TAB_URL, "tab", {userContextId}); - } - }; - items.addEventListener("command", onItemCommand); - - if (PrivateBrowsingUtils.isWindowPrivate(win)) { - aNode.setAttribute("disabled", "true"); - } - - this.updateVisibility(aNode); - - if (!this.hasObserver) { - Services.prefs.addObserver("privacy.userContext.enabled", this, true); - this.hasObserver = true; - } - }, - onViewShowing: function(aEvent) { - let doc = aEvent.target.ownerDocument; - - let items = doc.getElementById("PanelUI-containersItems"); - - while (items.firstChild) { - items.firstChild.remove(); - } - - let fragment = doc.createDocumentFragment(); - let bundle = doc.getElementById("bundle_browser"); - - ContextualIdentityService.getIdentities().forEach(identity => { - let label = ContextualIdentityService.getUserContextLabel(identity.userContextId); - - let item = doc.createElementNS(kNSXUL, "toolbarbutton"); - item.setAttribute("label", label); - item.setAttribute("usercontextid", identity.userContextId); - item.setAttribute("class", "subviewbutton"); - item.setAttribute("data-identity-color", identity.color); - item.setAttribute("data-identity-icon", identity.icon); - - fragment.appendChild(item); - }); - - fragment.appendChild(doc.createElementNS(kNSXUL, "menuseparator")); - - let item = doc.createElementNS(kNSXUL, "toolbarbutton"); - item.setAttribute("label", bundle.getString("userContext.aboutPage.label")); - item.setAttribute("command", "Browser:OpenAboutContainers"); - item.setAttribute("class", "subviewbutton"); - fragment.appendChild(item); - - items.appendChild(fragment); - }, - - updateVisibility(aNode) { - aNode.hidden = !Services.prefs.getBoolPref("privacy.userContext.enabled"); - }, - - observe(aSubject, aTopic, aData) { - let {instances} = CustomizableUI.getWidget("containers-panelmenu"); - for (let {node} of instances) { - if (node) { - this.updateVisibility(node); - } - } - }, - - QueryInterface: XPCOMUtils.generateQI([ - Ci.nsISupportsWeakReference, - Ci.nsIObserver - ]), }]; let preferencesButton = { diff --git a/components/moz.build b/components/moz.build index 392c326..574b907 100644 --- a/components/moz.build +++ b/components/moz.build @@ -6,7 +6,6 @@ DIRS += [ 'about', - 'contextualidentity', 'customizableui', 'dirprovider', 'downloads', diff --git a/components/preferences/containers.js b/components/preferences/containers.js deleted file mode 100644 index 6ca5853..0000000 --- a/components/preferences/containers.js +++ /dev/null @@ -1,176 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -Components.utils.import("resource://gre/modules/Services.jsm"); -Components.utils.import("resource://gre/modules/ContextualIdentityService.jsm"); - -const containersBundle = Services.strings.createBundle("chrome://browser/locale/preferences/containers.properties"); - -const HTMLNS = "http://www.w3.org/1999/xhtml"; - -let gContainersManager = { - icons: [ - "fingerprint", - "briefcase", - "dollar", - "cart", - "circle" - ], - - colors: [ - "blue", - "turquoise", - "green", - "yellow", - "orange", - "red", - "pink", - "purple" - ], - - onLoad() { - let params = window.arguments[0] || {}; - this.init(params); - }, - - init(aParams) { - this.userContextId = aParams.userContextId || null; - this.identity = aParams.identity; - - if (aParams.windowTitle) { - document.title = aParams.windowTitle; - } - - const iconWrapper = document.getElementById("iconWrapper"); - iconWrapper.appendChild(this.createIconButtons()); - - const colorWrapper = document.getElementById("colorWrapper"); - colorWrapper.appendChild(this.createColorSwatches()); - - if (this.identity.name) { - const name = document.getElementById("name"); - name.value = this.identity.name; - this.checkForm(); - } - - this.setLabelsMinWidth(); - - // This is to prevent layout jank caused by the svgs and outlines rendering at different times - document.getElementById("containers-content").removeAttribute("hidden"); - }, - - setLabelsMinWidth() { - const labelMinWidth = containersBundle.GetStringFromName("containers.labelMinWidth"); - const labels = [ - document.getElementById("nameLabel"), - document.getElementById("iconLabel"), - document.getElementById("colorLabel") - ]; - for (let label of labels) { - label.style.minWidth = labelMinWidth; - } - }, - - uninit() { - }, - - // Check if name string as to if the form can be submitted - checkForm() { - const name = document.getElementById("name"); - let btnApplyChanges = document.getElementById("btnApplyChanges"); - if (!name.value) { - btnApplyChanges.setAttribute("disabled", true); - } else { - btnApplyChanges.removeAttribute("disabled"); - } - }, - - createIconButtons(defaultIcon) { - let radiogroup = document.createElement("radiogroup"); - radiogroup.setAttribute("id", "icon"); - radiogroup.className = "icon-buttons"; - - for (let icon of this.icons) { - let iconSwatch = document.createElement("radio"); - iconSwatch.id = "iconbutton-" + icon; - iconSwatch.name = "icon"; - iconSwatch.type = "radio"; - iconSwatch.value = icon; - - if (this.identity.icon && this.identity.icon == icon) { - iconSwatch.setAttribute("selected", true); - } - - iconSwatch.setAttribute("label", - containersBundle.GetStringFromName(`containers.${icon}.label`)); - let iconElement = document.createElement("hbox"); - iconElement.className = 'userContext-icon'; - iconElement.setAttribute("data-identity-icon", icon); - - iconSwatch.appendChild(iconElement); - radiogroup.appendChild(iconSwatch); - } - - return radiogroup; - }, - - createColorSwatches(defaultColor) { - let radiogroup = document.createElement("radiogroup"); - radiogroup.setAttribute("id", "color"); - - for (let color of this.colors) { - let colorSwatch = document.createElement("radio"); - colorSwatch.id = "colorswatch-" + color; - colorSwatch.name = "color"; - colorSwatch.type = "radio"; - colorSwatch.value = color; - - if (this.identity.color && this.identity.color == color) { - colorSwatch.setAttribute("selected", true); - } - - colorSwatch.setAttribute("label", - containersBundle.GetStringFromName(`containers.${color}.label`)); - let iconElement = document.createElement("hbox"); - iconElement.className = 'userContext-icon'; - iconElement.setAttribute("data-identity-icon", "circle"); - iconElement.setAttribute("data-identity-color", color); - - colorSwatch.appendChild(iconElement); - radiogroup.appendChild(colorSwatch); - } - return radiogroup; - }, - - onApplyChanges() { - let icon = document.getElementById("icon").value; - let color = document.getElementById("color").value; - let name = document.getElementById("name").value; - - if (this.icons.indexOf(icon) == -1) { - throw "Internal error. The icon value doesn't match."; - } - - if (this.colors.indexOf(color) == -1) { - throw "Internal error. The color value doesn't match."; - } - - if (this.userContextId) { - ContextualIdentityService.update(this.userContextId, - name, - icon, - color); - } else { - ContextualIdentityService.create(name, - icon, - color); - } - window.parent.location.reload() - }, - - onWindowKeyPress(aEvent) { - if (aEvent.keyCode == KeyEvent.DOM_VK_ESCAPE) - window.close(); - } -} diff --git a/components/preferences/containers.xul b/components/preferences/containers.xul deleted file mode 100644 index 62a775f..0000000 --- a/components/preferences/containers.xul +++ /dev/null @@ -1,52 +0,0 @@ -<?xml version="1.0"?> - -<!-- This Source Code Form is subject to the terms of the Mozilla Public - - License, v. 2.0. If a copy of the MPL was not distributed with this - - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - -<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> -<?xml-stylesheet href="chrome://browser/skin/preferences/containers.css" type="text/css"?> - -<!DOCTYPE dialog SYSTEM "chrome://browser/locale/preferences/containers.dtd" > - -<window id="ContainersDialog" class="windowDialog" - windowtype="Browser:Permissions" - title="&window.title;" - xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - style="width: &window.width;;" - onload="gContainersManager.onLoad();" - onunload="gContainersManager.uninit();" - persist="screenX screenY width height" - onkeypress="gContainersManager.onWindowKeyPress(event);"> - - <script src="chrome://global/content/treeUtils.js"/> - <script src="chrome://browser/content/preferences/containers.js"/> - - <stringbundle id="bundlePreferences" - src="chrome://browser/locale/preferences/preferences.properties"/> - - <keyset> - <key key="&windowClose.key;" modifiers="accel" oncommand="window.close();"/> - </keyset> - - <vbox class="contentPane largeDialogContainer" flex="1" hidden="true" id="containers-content"> - <description id="permissionsText" control="url"/> - <separator class="thin"/> - <hbox align="start"> - <label id="nameLabel" control="url" value="&name.label;" accesskey="&name.accesskey;"/> - <textbox id="name" flex="1" onkeyup="gContainersManager.checkForm();" /> - </hbox> - <hbox align="center" id="iconWrapper"> - <label id="iconLabel" control="url" value="&icon.label;" accesskey="&icon.accesskey;"/> - </hbox> - <hbox align="center" id="colorWrapper"> - <label id="colorLabel" control="url" value="&color.label;" accesskey="&color.accesskey;"/> - </hbox> - </vbox> - <vbox> - <hbox class="actionButtons" align="right" flex="1"> - <button id="btnApplyChanges" disabled="true" oncommand="gContainersManager.onApplyChanges();" icon="save" - label="&button.ok.label;" accesskey="&button.ok.accesskey;"/> - </hbox> - </vbox> -</window> diff --git a/components/preferences/cookies.js b/components/preferences/cookies.js index c420855..27f6534 100644 --- a/components/preferences/cookies.js +++ b/components/preferences/cookies.js @@ -7,12 +7,8 @@ const nsICookie = Components.interfaces.nsICookie; Components.utils.import("resource://gre/modules/AppConstants.jsm"); Components.utils.import("resource://gre/modules/PluralForm.jsm"); -Components.utils.import("resource://gre/modules/Services.jsm") Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService", - "resource://gre/modules/ContextualIdentityService.jsm"); - var gCookiesWindow = { _cm : Components.classes["@mozilla.org/cookiemanager;1"] .getService(Components.interfaces.nsICookieManager), @@ -38,10 +34,6 @@ var gCookiesWindow = { this._populateList(true); document.getElementById("filter").focus(); - - if (!Services.prefs.getBoolPref("privacy.userContext.enabled")) { - document.getElementById("userContextRow").hidden = true; - } }, uninit: function () { @@ -82,23 +74,11 @@ var gCookiesWindow = { aCookieB.originAttributes); }, - _isPrivateCookie: function (aCookie) { - let { userContextId } = aCookie.originAttributes; - if (!userContextId) { - // Default identity is public. - return false; - } - return !ContextualIdentityService.getIdentityFromId(userContextId).public; - }, - observe: function (aCookie, aTopic, aData) { if (aTopic != "cookie-changed") return; if (aCookie instanceof Components.interfaces.nsICookie) { - if (this._isPrivateCookie(aCookie)) { - return; - } var strippedHost = this._makeStrippedHost(aCookie.host); if (aData == "changed") @@ -498,9 +478,6 @@ var gCookiesWindow = { while (e.hasMoreElements()) { var cookie = e.getNext(); if (cookie && cookie instanceof Components.interfaces.nsICookie) { - if (this._isPrivateCookie(cookie)) { - continue; - } var strippedHost = this._makeStrippedHost(cookie.host); this._addCookie(strippedHost, cookie, hostCount); @@ -524,17 +501,9 @@ var gCookiesWindow = { return this._bundle.getString("expireAtEndOfSession"); }, - _getUserContextString: function(aUserContextId) { - if (parseInt(aUserContextId) == 0) { - return this._bundle.getString("defaultUserContextLabel"); - } - - return ContextualIdentityService.getUserContextLabel(aUserContextId); - }, - _updateCookieData: function (aItem) { var seln = this._view.selection; - var ids = ["name", "value", "host", "path", "isSecure", "expires", "userContext"]; + var ids = ["name", "value", "host", "path", "isSecure", "expires"]; var properties; if (aItem && !aItem.container && seln.count > 0) { @@ -543,8 +512,7 @@ var gCookiesWindow = { isDomain: aItem.isDomain ? this._bundle.getString("domainColon") : this._bundle.getString("hostColon"), isSecure: aItem.isSecure ? this._bundle.getString("forSecureOnly") - : this._bundle.getString("forAnyConnection"), - userContext: this._getUserContextString(aItem.originAttributes.userContextId) }; + : this._bundle.getString("forAnyConnection") }; for (let id of ids) { document.getElementById(id).disabled = false; } @@ -553,7 +521,7 @@ var gCookiesWindow = { var noneSelected = this._bundle.getString("noCookieSelected"); properties = { name: noneSelected, value: noneSelected, host: noneSelected, path: noneSelected, expires: noneSelected, - isSecure: noneSelected, userContext: noneSelected }; + isSecure: noneSelected }; for (let id of ids) { document.getElementById(id).disabled = true; } diff --git a/components/preferences/cookies.xul b/components/preferences/cookies.xul index bd60d93..d5fefde 100644 --- a/components/preferences/cookies.xul +++ b/components/preferences/cookies.xul @@ -85,10 +85,6 @@ <hbox pack="end"><label id="expiresLabel" control="expires" value="&props.expires.label;"/></hbox> <textbox id="expires" readonly="true" class="plain"/> </row> - <row align="center" id="userContextRow"> - <hbox pack="end"><label id="userContextLabel" control="userContext" value="&props.container.label;"/></hbox> - <textbox id="userContext" readonly="true" class="plain"/> - </row> </rows> </grid> </hbox> diff --git a/components/preferences/handlers.css b/components/preferences/handlers.css index 6af75a0..d5f1008 100644 --- a/components/preferences/handlers.css +++ b/components/preferences/handlers.css @@ -10,10 +10,6 @@ -moz-binding: url("chrome://browser/content/preferences/handlers.xml#handler-selected"); } -#containersView > richlistitem { - -moz-binding: url("chrome://browser/content/preferences/handlers.xml#container"); -} - /** * Make the icons appear. * Note: we display the icon box for every item whether or not it has an icon diff --git a/components/preferences/handlers.xml b/components/preferences/handlers.xml index 0c629d7..ad07a49 100644 --- a/components/preferences/handlers.xml +++ b/components/preferences/handlers.xml @@ -69,29 +69,6 @@ </binding> - <binding id="container"> - <content> - <xul:hbox flex="1" equalsize="always"> - <xul:hbox flex="1" align="center"> - <xul:hbox xbl:inherits="data-identity-icon=containerIcon,data-identity-color=containerColor" height="24" width="24" class="userContext-icon"/> - <xul:label flex="1" crop="end" xbl:inherits="value=containerName"/> - </xul:hbox> - <xul:hbox flex="1" align="right"> - <xul:button anonid="preferencesButton" - xbl:inherits="value=userContextId" - onclick="gContainersPane.onPeferenceClick(event.originalTarget)"> - Preferences - </xul:button> - <xul:button anonid="removeButton" - xbl:inherits="value=userContextId" - onclick="gContainersPane.onRemoveClick(event.originalTarget)"> - Remove - </xul:button> - </xul:hbox> - </xul:hbox> - </content> - </binding> - <binding id="offlineapp" extends="chrome://global/content/bindings/listbox.xml#listitem"> <content> diff --git a/components/preferences/in-content/containers.js b/components/preferences/in-content/containers.js deleted file mode 100644 index 758e45f..0000000 --- a/components/preferences/in-content/containers.js +++ /dev/null @@ -1,73 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -Components.utils.import("resource://gre/modules/AppConstants.jsm"); -Components.utils.import("resource://gre/modules/ContextualIdentityService.jsm"); - -const containersBundle = Services.strings.createBundle("chrome://browser/locale/preferences/containers.properties"); - -const defaultContainerIcon = "fingerprint"; -const defaultContainerColor = "blue"; - -let gContainersPane = { - - init() { - this._list = document.getElementById("containersView"); - - document.getElementById("backContainersLink").addEventListener("click", function () { - gotoPref("privacy"); - }); - - this._rebuildView(); - }, - - _rebuildView() { - const containers = ContextualIdentityService.getIdentities(); - while (this._list.firstChild) { - this._list.firstChild.remove(); - } - for (let container of containers) { - let item = document.createElement("richlistitem"); - item.setAttribute("containerName", ContextualIdentityService.getUserContextLabel(container.userContextId)); - item.setAttribute("containerIcon", container.icon); - item.setAttribute("containerColor", container.color); - item.setAttribute("userContextId", container.userContextId); - - this._list.appendChild(item); - } - }, - - onRemoveClick(button) { - let userContextId = button.getAttribute("value"); - ContextualIdentityService.remove(userContextId); - this._rebuildView(); - }, - onPeferenceClick(button) { - this.openPreferenceDialog(button.getAttribute("value")); - }, - - onAddButtonClick(button) { - this.openPreferenceDialog(null); - }, - - openPreferenceDialog(userContextId) { - let identity = { - name: "", - icon: defaultContainerIcon, - color: defaultContainerColor - }; - let title; - if (userContextId) { - identity = ContextualIdentityService.getIdentityFromId(userContextId); - // This is required to get the translation string from defaults - identity.name = ContextualIdentityService.getUserContextLabel(identity.userContextId); - title = containersBundle.formatStringFromName("containers.updateContainerTitle", [identity.name], 1); - } - - const params = { userContextId, identity, windowTitle: title }; - gSubDialog.open("chrome://browser/content/preferences/containers.xul", - null, params); - } - -}; diff --git a/components/preferences/in-content/containers.xul b/components/preferences/in-content/containers.xul deleted file mode 100644 index e83bac1..0000000 --- a/components/preferences/in-content/containers.xul +++ /dev/null @@ -1,54 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -<!-- Containers panel --> - -<script type="application/javascript" - src="chrome://browser/content/preferences/in-content/containers.js"/> - -<preferences id="containerPreferences" hidden="true" data-category="paneContainer"> - <!-- Containers --> - <preference id="privacy.userContext.enabled" - name="privacy.userContext.enabled" - type="bool"/> - -</preferences> - -<hbox hidden="true" - class="container-header-links" - data-category="paneContainers"> - <label class="text-link" id="backContainersLink" value="&backLink.label;" /> -</hbox> - -<hbox id="header-containers" - class="header" - hidden="true" - data-category="paneContainers"> - <label class="header-name" flex="1">&paneContainers.title;</label> - <button class="help-button" - aria-label="&helpButton.label;"/> -</hbox> - -<!-- Containers --> -<groupbox id="browserContainersGroup" data-category="paneContainers" hidden="true"> - <vbox id="browserContainersbox"> - - <richlistbox id="containersView" orient="vertical" persist="lastSelectedType" - flex="1"> - <listheader equalsize="always"> - <treecol id="typeColumn" label="&label.label;" value="type" - persist="sortDirection" - flex="1" sortDirection="ascending"/> - <treecol id="actionColumn" value="action" - persist="sortDirection" - flex="1"/> - </listheader> - </richlistbox> - </vbox> - <vbox> - <hbox flex="1"> - <button onclick="gContainersPane.onAddButtonClick();" accesskey="&addButton.accesskey;" label="&addButton.label;"/> - </hbox> - </vbox> -</groupbox> diff --git a/components/preferences/in-content/jar.mn b/components/preferences/in-content/jar.mn index 130bf85..5e6070c 100644 --- a/components/preferences/in-content/jar.mn +++ b/components/preferences/in-content/jar.mn @@ -9,7 +9,6 @@ browser.jar: content/browser/preferences/in-content/main.js content/browser/preferences/in-content/privacy.js - content/browser/preferences/in-content/containers.js content/browser/preferences/in-content/advanced.js content/browser/preferences/in-content/applications.js * content/browser/preferences/in-content/content.js diff --git a/components/preferences/in-content/preferences.js b/components/preferences/in-content/preferences.js index e18ab4b..35e10c5 100644 --- a/components/preferences/in-content/preferences.js +++ b/components/preferences/in-content/preferences.js @@ -61,7 +61,6 @@ function init_all() { register_module("paneGeneral", gMainPane); register_module("paneSearch", gSearchPane); register_module("panePrivacy", gPrivacyPane); - register_module("paneContainers", gContainersPane); register_module("paneAdvanced", gAdvancedPane); register_module("paneApplications", gApplicationsPane); register_module("paneContent", gContentPane); diff --git a/components/preferences/in-content/preferences.xul b/components/preferences/in-content/preferences.xul index 7ec7ef1..0935161 100644 --- a/components/preferences/in-content/preferences.xul +++ b/components/preferences/in-content/preferences.xul @@ -13,7 +13,6 @@ href="chrome://browser/content/preferences/handlers.css"?> <?xml-stylesheet href="chrome://browser/skin/preferences/applications.css"?> <?xml-stylesheet href="chrome://browser/skin/preferences/in-content/search.css"?> -<?xml-stylesheet href="chrome://browser/skin/preferences/in-content/containers.css"?> <!DOCTYPE page [ <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd"> @@ -27,8 +26,6 @@ <!ENTITY % syncDTD SYSTEM "chrome://browser/locale/preferences/sync.dtd"> <!ENTITY % securityDTD SYSTEM "chrome://browser/locale/preferences/security.dtd"> -<!ENTITY % containersDTD SYSTEM - "chrome://browser/locale/preferences/containers.dtd"> <!ENTITY % sanitizeDTD SYSTEM "chrome://browser/locale/sanitize.dtd"> <!ENTITY % mainDTD SYSTEM "chrome://browser/locale/preferences/main.dtd"> <!ENTITY % aboutHomeDTD SYSTEM "chrome://browser/locale/aboutHome.dtd"> @@ -46,7 +43,6 @@ %syncBrandDTD; %syncDTD; %securityDTD; -%containersDTD; %sanitizeDTD; %mainDTD; %aboutHomeDTD; @@ -134,12 +130,6 @@ <label class="category-name" flex="1">&panePrivacy.title;</label> </richlistitem> - <richlistitem id="category-containers" - class="category" - value="paneContainers" - helpTopic="prefs-containers" - hidden="true"/> - <richlistitem id="category-security" class="category" value="paneSecurity" @@ -183,7 +173,6 @@ #include main.xul #include search.xul #include privacy.xul -#include containers.xul #include advanced.xul #include applications.xul #include content.xul diff --git a/components/preferences/in-content/privacy.js b/components/preferences/in-content/privacy.js index 7dfc7de..fc7857b 100644 --- a/components/preferences/in-content/privacy.js +++ b/components/preferences/in-content/privacy.js @@ -5,8 +5,6 @@ Components.utils.import("resource://gre/modules/AppConstants.jsm"); Components.utils.import("resource://gre/modules/PluralForm.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService", - "resource://gre/modules/ContextualIdentityService.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm"); @@ -60,59 +58,6 @@ var gPrivacyPane = { }, /** - * Show the Containers UI depending on the privacy.userContext.ui.enabled pref. - */ - _initBrowserContainers: function () { - if (!Services.prefs.getBoolPref("privacy.userContext.ui.enabled")) { - return; - } - - let link = document.getElementById("browserContainersLearnMore"); - link.href = Services.urlFormatter.formatURLPref("app.support.baseURL") + "containers"; - - document.getElementById("browserContainersbox").hidden = false; - - document.getElementById("browserContainersCheckbox").checked = - Services.prefs.getBoolPref("privacy.userContext.enabled"); - }, - - _checkBrowserContainers: function(event) { - let checkbox = document.getElementById("browserContainersCheckbox"); - if (checkbox.checked) { - Services.prefs.setBoolPref("privacy.userContext.enabled", true); - return; - } - - let count = ContextualIdentityService.countContainerTabs(); - if (count == 0) { - Services.prefs.setBoolPref("privacy.userContext.enabled", false); - return; - } - - let bundlePreferences = document.getElementById("bundlePreferences"); - - let title = bundlePreferences.getString("disableContainersAlertTitle"); - let message = PluralForm.get(count, bundlePreferences.getString("disableContainersMsg")) - .replace("#S", count) - let okButton = PluralForm.get(count, bundlePreferences.getString("disableContainersOkButton")) - .replace("#S", count) - let cancelButton = bundlePreferences.getString("disableContainersButton2"); - - let buttonFlags = (Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_0) + - (Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_1); - - let rv = Services.prompt.confirmEx(window, title, message, buttonFlags, - okButton, cancelButton, null, null, {}); - if (rv == 0) { - ContextualIdentityService.closeAllContainerTabs(); - Services.prefs.setBoolPref("privacy.userContext.enabled", false); - return; - } - - checkbox.checked = true; - }, - - /** * Sets up the UI for the number of days of history to keep, and updates the * label of the "Clear Now..." button. */ @@ -132,7 +77,6 @@ var gPrivacyPane = { this._initTrackingProtection(); this._initTrackingProtectionPBM(); this._initAutocomplete(); - this._initBrowserContainers(); setEventListener("privacy.sanitize.sanitizeOnShutdown", "change", gPrivacyPane._updateSanitizeSettingsButton); @@ -176,10 +120,6 @@ var gPrivacyPane = { gPrivacyPane.showBlockLists); setEventListener("changeBlockListPBM", "command", gPrivacyPane.showBlockLists); - setEventListener("browserContainersCheckbox", "command", - gPrivacyPane._checkBrowserContainers); - setEventListener("browserContainersSettings", "command", - gPrivacyPane.showContainerSettings); }, // TRACKING PROTECTION MODE @@ -478,13 +418,6 @@ var gPrivacyPane = { }, /** - * Displays container panel for customising and adding containers. - */ - showContainerSettings() { - gotoPref("containers"); - }, - - /** * Displays the available block lists for tracking protection. */ showBlockLists: function () @@ -689,24 +622,4 @@ var gPrivacyPane = { settingsButton.disabled = !sanitizeOnShutdownPref.value; }, - // CONTAINERS - - /* - * preferences: - * - * privacy.userContext.enabled - * - true if containers is enabled - */ - - /** - * Enables/disables the Settings button used to configure containers - */ - readBrowserContainersCheckbox: function () - { - var pref = document.getElementById("privacy.userContext.enabled"); - var settings = document.getElementById("browserContainersSettings"); - - settings.disabled = !pref.value; - } - }; diff --git a/components/preferences/in-content/privacy.xul b/components/preferences/in-content/privacy.xul index 6ac6c88..5efd79a 100644 --- a/components/preferences/in-content/privacy.xul +++ b/components/preferences/in-content/privacy.xul @@ -281,28 +281,3 @@ &suggestionSettings.label; </label> </groupbox> - -<!-- Containers --> -<groupbox id="browserContainersGroup" data-category="panePrivacy" hidden="true"> - <vbox id="browserContainersbox" hidden="true"> - <caption><label>&browserContainersHeader.label; - <label id="browserContainersLearnMore" class="text-link" - value="&browserContainersLearnMore.label;"/> - </label></caption> - <hbox align="start"> - <vbox> - <checkbox id="browserContainersCheckbox" - label="&browserContainersEnabled.label;" - accesskey="&browserContainersEnabled.accesskey;" - preference="privacy.userContext.enabled" - onsyncfrompreference="return gPrivacyPane.readBrowserContainersCheckbox();"/> - </vbox> - <spacer flex="1"/> - <vbox> - <button id="browserContainersSettings" - label="&browserContainersSettings.label;" - accesskey="&browserContainersSettings.accesskey;"/> - </vbox> - </hbox> - </vbox> -</groupbox> diff --git a/components/preferences/jar.mn b/components/preferences/jar.mn index c0d34da..6287c38 100644 --- a/components/preferences/jar.mn +++ b/components/preferences/jar.mn @@ -20,8 +20,6 @@ browser.jar: * content/browser/preferences/languages.xul content/browser/preferences/languages.js content/browser/preferences/permissions.xul - content/browser/preferences/containers.xul - content/browser/preferences/containers.js content/browser/preferences/permissions.js content/browser/preferences/sanitize.xul content/browser/preferences/sanitize.js diff --git a/locales/en-US/chrome/browser/browser.properties b/locales/en-US/chrome/browser/browser.properties index a322186..7c46200 100644 --- a/locales/en-US/chrome/browser/browser.properties +++ b/locales/en-US/chrome/browser/browser.properties @@ -627,37 +627,6 @@ e10s.accessibilityNotice.acceptButton.accesskey = O e10s.accessibilityNotice.enableAndRestart.label = Enable (Requires Restart) e10s.accessibilityNotice.enableAndRestart.accesskey = E -# LOCALIZATION NOTE (userContextPersonal.label, -# userContextWork.label, -# userContextShopping.label, -# userContextBanking.label, -# userContextNone.label): -# These strings specify the four predefined contexts included in support of the -# Contextual Identity / Containers project. Each context is meant to represent -# the context that the user is in when interacting with the site. Different -# contexts will store cookies and other information from those sites in -# different, isolated locations. You can enable the feature by typing -# about:config in the URL bar and changing privacy.userContext.enabled to true. -# Once enabled, you can open a new tab in a specific context by clicking -# File > New Container Tab > (1 of 4 contexts). Once opened, you will see these -# strings on the right-hand side of the URL bar. -userContextPersonal.label = Personal -userContextWork.label = Work -userContextBanking.label = Banking -userContextShopping.label = Shopping -userContextNone.label = No Container - -userContextPersonal.accesskey = P -userContextWork.accesskey = W -userContextBanking.accesskey = B -userContextShopping.accesskey = S -userContextNone.accesskey = N - -userContext.aboutPage.label = Manage containers -userContext.aboutPage.accesskey = O - -userContextOpenLink.label = Open Link in New %S Tab - muteTab.label = Mute Tab muteTab.accesskey = M unmuteTab.label = Unmute Tab diff --git a/locales/en-US/chrome/browser/preferences/containers.dtd b/locales/en-US/chrome/browser/preferences/containers.dtd deleted file mode 100644 index 58eca1a..0000000 --- a/locales/en-US/chrome/browser/preferences/containers.dtd +++ /dev/null @@ -1,24 +0,0 @@ -<!-- This Source Code Form is subject to the terms of the Mozilla Public - - License, v. 2.0. If a copy of the MPL was not distributed with this - - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - -<!ENTITY label.label "Name"> -<!ENTITY addButton.label "Add New Container"> -<!ENTITY addButton.accesskey "A"> -<!-- « is « however it's not defined in XML --> -<!ENTITY backLink.label "« Go Back to Privacy"> - -<!ENTITY window.title "Add New Container"> -<!ENTITY window.width "45em"> - -<!ENTITY name.label "Name:"> -<!ENTITY name.accesskey "N"> -<!ENTITY icon.label "Icon:"> -<!ENTITY icon.accesskey "I"> -<!ENTITY color.label "Color:"> -<!ENTITY color.accesskey "o"> -<!ENTITY windowClose.key "w"> - -<!ENTITY button.ok.label "Done"> -<!ENTITY button.ok.accesskey "D"> - diff --git a/locales/en-US/chrome/browser/preferences/containers.properties b/locales/en-US/chrome/browser/preferences/containers.properties deleted file mode 100644 index 9866a06..0000000 --- a/locales/en-US/chrome/browser/preferences/containers.properties +++ /dev/null @@ -1,31 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -containers.removeButton = Remove -containers.preferencesButton = Preferences -containers.colorHeading = Color: -containers.labelMinWidth = 4rem -containers.nameLabel = Name: -containers.namePlaceholder = Enter a container name -containers.submitButton = Done -containers.iconHeading = Icon: -containers.updateContainerTitle = %S Container Preferences - -containers.blue.label = Blue -containers.turquoise.label = Turquoise -containers.green.label = Green -containers.yellow.label = Yellow -containers.orange.label = Orange -containers.red.label = Red -containers.pink.label = Pink -containers.purple.label = Purple - -containers.fingerprint.label = Fingerprint -containers.briefcase.label = Briefcase -# LOCALIZATION NOTE (containers.dollar.label) -# String represents a money sign but currently uses a dollar sign so don't change to local currency -# See Bug 1291672 -containers.dollar.label = Dollar sign -containers.cart.label = Shopping cart -containers.circle.label = Dot diff --git a/locales/en-US/chrome/browser/preferences/cookies.dtd b/locales/en-US/chrome/browser/preferences/cookies.dtd index 5e7df96..c833313 100644 --- a/locales/en-US/chrome/browser/preferences/cookies.dtd +++ b/locales/en-US/chrome/browser/preferences/cookies.dtd @@ -14,7 +14,6 @@ <!ENTITY props.path.label "Path:"> <!ENTITY props.secure.label "Send For:"> <!ENTITY props.expires.label "Expires:"> -<!ENTITY props.container.label "Container:"> <!ENTITY window.title "Cookies"> <!ENTITY windowClose.key "w"> diff --git a/locales/en-US/chrome/browser/preferences/preferences.dtd b/locales/en-US/chrome/browser/preferences/preferences.dtd index 7702c8c..353e627 100644 --- a/locales/en-US/chrome/browser/preferences/preferences.dtd +++ b/locales/en-US/chrome/browser/preferences/preferences.dtd @@ -18,7 +18,6 @@ <!ENTITY paneContent.title "Content"> <!ENTITY paneApplications.title "Applications"> <!ENTITY panePrivacy.title "Privacy"> -<!ENTITY paneContainers.title "Container Tabs"> <!ENTITY paneSecurity.title "Security"> <!ENTITY paneAdvanced.title "Advanced"> diff --git a/locales/en-US/chrome/browser/preferences/preferences.properties b/locales/en-US/chrome/browser/preferences/preferences.properties index da40f40..37fd122 100644 --- a/locales/en-US/chrome/browser/preferences/preferences.properties +++ b/locales/en-US/chrome/browser/preferences/preferences.properties @@ -191,17 +191,3 @@ revertNoRestartButton=Revert restartNow=Restart Now restartLater=Restart Later - -disableContainersAlertTitle=Close All Container Tabs? - -# LOCALIZATION NOTE (disableContainersMsg): Semi-colon list of plural forms. -# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals -# #S is the number of container tabs -disableContainersMsg=If you disable Container Tabs now, #S container tab will be closed. Are you sure you want to disable Container Tabs?;If you disable Container Tabs now, #S container tabs will be closed. Are you sure you want to disable Container Tabs? - -# LOCALIZATION NOTE (disableContainersOkButton): Semi-colon list of plural forms. -# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals -# #S is the number of container tabs -disableContainersOkButton=Close #S Container Tab;Close #S Container Tabs - -disableContainersButton2=Keep enabled diff --git a/locales/en-US/chrome/browser/preferences/privacy.dtd b/locales/en-US/chrome/browser/preferences/privacy.dtd index 4c38c11..11eb25f 100644 --- a/locales/en-US/chrome/browser/preferences/privacy.dtd +++ b/locales/en-US/chrome/browser/preferences/privacy.dtd @@ -104,10 +104,3 @@ <!ENTITY clearOnCloseSettings.label "Settingsā¦"> <!ENTITY clearOnCloseSettings.accesskey "t"> - -<!ENTITY browserContainersHeader.label "Container Tabs"> -<!ENTITY browserContainersLearnMore.label "Learn more"> -<!ENTITY browserContainersEnabled.label "Enable Container Tabs"> -<!ENTITY browserContainersEnabled.accesskey "n"> -<!ENTITY browserContainersSettings.label "Settingsā¦"> -<!ENTITY browserContainersSettings.accesskey "i"> diff --git a/locales/jar.mn b/locales/jar.mn index 2e660de..6295fef 100644 --- a/locales/jar.mn +++ b/locales/jar.mn @@ -77,10 +77,8 @@ locale/browser/preferences/permissions.dtd (%chrome/browser/preferences/permissions.dtd) locale/browser/preferences/preferences.dtd (%chrome/browser/preferences/preferences.dtd) locale/browser/preferences/preferences.properties (%chrome/browser/preferences/preferences.properties) - locale/browser/preferences/containers.properties (%chrome/browser/preferences/containers.properties) locale/browser/preferences/privacy.dtd (%chrome/browser/preferences/privacy.dtd) locale/browser/preferences/security.dtd (%chrome/browser/preferences/security.dtd) - locale/browser/preferences/containers.dtd (%chrome/browser/preferences/containers.dtd) locale/browser/preferences/sync.dtd (%chrome/browser/preferences/sync.dtd) locale/browser/preferences/tabs.dtd (%chrome/browser/preferences/tabs.dtd) locale/browser/preferences/search.dtd (%chrome/browser/preferences/search.dtd) diff --git a/themes/shared/incontentprefs/containers.css b/themes/shared/incontentprefs/containers.css deleted file mode 100644 index 5446dcc..0000000 --- a/themes/shared/incontentprefs/containers.css +++ /dev/null @@ -1,32 +0,0 @@ -/* Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -%include ../../../components/contextualidentity/content/usercontext.css - -.container-header-links { - margin-block-end: 15px; -} - -[data-identity-icon] { - margin: 0; - margin-inline-end: 16px; -} - -#containersView { - border: 0 none; - background: transparent; -} - -#containersView richlistitem { - margin: 0px; - margin-inline-end: 8px; - padding: 0; - padding-block-end: 8px; - border-block-end: 1px solid var(--in-content-header-border-color); -} - -#containersView richlistitem:last-of-type { - border-block-end: 0 none; - margin-block-end: 8px; -} diff --git a/themes/shared/incontentprefs/preferences.inc.css b/themes/shared/incontentprefs/preferences.inc.css index 0e62660..20ea983 100644 --- a/themes/shared/incontentprefs/preferences.inc.css +++ b/themes/shared/incontentprefs/preferences.inc.css @@ -237,8 +237,7 @@ treecol { /* Privacy pane */ #trackingProtectionPBMLearnMore, -#trackingProtectionLearnMore, -#browserContainersLearnMore { +#trackingProtectionLearnMore { margin-inline-start: 1.5em !important; margin-top: 0; font-weight: normal; diff --git a/themes/shared/jar.inc.mn b/themes/shared/jar.inc.mn index 2c75aeb..f045060 100644 --- a/themes/shared/jar.inc.mn +++ b/themes/shared/jar.inc.mn @@ -74,8 +74,6 @@ skin/classic/browser/preferences/in-content/favicon.ico (../shared/incontentprefs/favicon.ico) skin/classic/browser/preferences/in-content/icons.svg (../shared/incontentprefs/icons.svg) skin/classic/browser/preferences/in-content/search.css (../shared/incontentprefs/search.css) -* skin/classic/browser/preferences/in-content/containers.css (../shared/incontentprefs/containers.css) -* skin/classic/browser/preferences/containers.css (../shared/preferences/containers.css) skin/classic/browser/fxa/default-avatar.svg (../shared/fxa/default-avatar.svg) skin/classic/browser/fxa/logo.png (../shared/fxa/logo.png) skin/classic/browser/fxa/logo@2x.png (../shared/fxa/logo@2x.png) diff --git a/themes/shared/preferences/containers.css b/themes/shared/preferences/containers.css deleted file mode 100644 index 3fb9653..0000000 --- a/themes/shared/preferences/containers.css +++ /dev/null @@ -1,53 +0,0 @@ -/* Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -%include ../../../components/contextualidentity/content/usercontext.css - -:root { - --preference-selected-color: #0996f8; - --preference-unselected-color: #333; - --preference-active-color: #858585; -} - -radiogroup { - display: flex; - margin-inline-start: 0.35rem; -} - -radio { - flex: auto; - display: flex; - align-items: center; - justify-content: center; - -moz-user-select: none; - outline: 2px solid transparent; - outline-offset: 4px; - -moz-outline-radius: 100%; - min-block-size: 24px; - min-inline-size: 24px; - border-radius: 50%; - padding: 2px; - margin: 10px; -} - -.icon-buttons > radio > [data-identity-icon] { - fill: #4d4d4d; -} - -radio > [data-identity-icon] { - inline-size: 22px; - block-size: 22px; -} - -radio[selected=true] { - outline-color: var(--preference-unselected-color); -} - -radio[focused=true] { - outline-color: var(--preference-selected-color); -} - -radio:hover:active { - outline-color: var(--preference-active-color); -} |