diff options
Diffstat (limited to 'application/basilisk')
46 files changed, 39 insertions, 1467 deletions
diff --git a/application/basilisk/app/profile/basilisk.js b/application/basilisk/app/profile/basilisk.js index 24f1c582cc..4700eac449 100644 --- a/application/basilisk/app/profile/basilisk.js +++ b/application/basilisk/app/profile/basilisk.js @@ -1293,17 +1293,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/application/basilisk/base/content/browser-context.inc b/application/basilisk/base/content/browser-context.inc index 36e0478af6..2f6b19da07 100644 --- a/application/basilisk/base/content/browser-context.inc +++ b/application/basilisk/base/content/browser-context.inc @@ -51,23 +51,11 @@ label="&openLinkCmdInCurrent.label;" accesskey="&openLinkCmdInCurrent.accesskey;" oncommand="gContextMenu.openLinkInCurrent();"/> -# label and data-usercontextid are dynamically set. - <menuitem id="context-openlinkincontainertab" - accesskey="&openLinkCmdInTab.accesskey;" - oncommand="gContextMenu.openLinkInTab(event);"/> +# label is dynamically set. <menuitem id="context-openlinkintab" label="&openLinkCmdInTab.label;" accesskey="&openLinkCmdInTab.accesskey;" - data-usercontextid="0" - oncommand="gContextMenu.openLinkInTab(event);"/> - - <menu id="context-openlinkinusercontext-menu" - label="&openLinkCmdInContainerTab.label;" - accesskey="&openLinkCmdInContainerTab.accesskey;" - hidden="true"> - <menupopup oncommand="gContextMenu.openLinkInTab(event);" - onpopupshowing="return gContextMenu.createContainerMenu(event);" /> - </menu> + oncommand="gContextMenu.openLinkInTab();"/> <menuitem id="context-openlink" label="&openLinkCmd.label;" diff --git a/application/basilisk/base/content/browser-menubar.inc b/application/basilisk/base/content/browser-menubar.inc index 41734711cd..0549ad915c 100644 --- a/application/basilisk/base/content/browser-menubar.inc +++ b/application/basilisk/base/content/browser-menubar.inc @@ -11,19 +11,12 @@ style="border:0px;padding:0px;margin:0px;-moz-appearance:none"> <menu id="file-menu" label="&fileMenu.label;" accesskey="&fileMenu.accesskey;"> - <menupopup id="menu_FilePopup" - onpopupshowing="updateUserContextUIVisibility();"> + <menupopup id="menu_FilePopup"> <menuitem id="menu_newNavigatorTab" label="&tabCmd.label;" command="cmd_newNavigatorTab" key="key_newNavigatorTab" accesskey="&tabCmd.accesskey;"/> - <menu id="menu_newUserContext" - label="&newUserContext.label;" - accesskey="&newUserContext.accesskey;" - hidden="true"> - <menupopup onpopupshowing="return createUserContextMenu(event);" /> - </menu> <menuitem id="menu_newNavigator" label="&newNavigatorCmd.label;" accesskey="&newNavigatorCmd.accesskey;" diff --git a/application/basilisk/base/content/browser.js b/application/basilisk/base/content/browser.js index e3a5393a01..ddbe11a9d5 100644 --- a/application/basilisk/base/content/browser.js +++ b/application/basilisk/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 @@ -827,10 +826,6 @@ function _loadURIWithFlags(browser, uri, params) { } try { if (!mustChangeProcess) { - if (params.userContextId) { - browser.webNavigation.setOriginAttributesBeforeLoading({ userContextId: params.userContextId }); - } - browser.webNavigation.loadURIWithOptions(uri, flags, referrer, referrerPolicy, postData, null, null, triggeringPrincipal); @@ -856,10 +851,6 @@ function _loadURIWithFlags(browser, uri, params) { postData: postData } - if (params.userContextId) { - loadParams.userContextId = params.userContextId; - } - LoadInOtherProcess(browser, loadParams); } } catch (e) { @@ -872,10 +863,6 @@ function _loadURIWithFlags(browser, uri, params) { Cu.reportError(e); gBrowser.updateBrowserRemotenessByURL(browser, uri); - if (params.userContextId) { - browser.webNavigation.setOriginAttributesBeforeLoading({ userContextId: params.userContextId }); - } - browser.webNavigation.loadURIWithOptions(uri, flags, referrer, referrerPolicy, postData, null, null, triggeringPrincipal); } else { @@ -939,16 +926,6 @@ addEventListener("DOMContentLoaded", function onDCL() { let initBrowser = document.getAnonymousElementByAttribute(gBrowser, "anonid", "initialBrowser"); - // The window's first argument is a tab if and only if we are swapping tabs. - // We must set the browser's usercontextid before updateBrowserRemoteness(), - // so that the newly created remote tab child has the correct usercontextid. - if (window.arguments) { - let tabToOpen = window.arguments[0]; - if (tabToOpen instanceof XULElement && tabToOpen.hasAttribute("usercontextid")) { - initBrowser.setAttribute("usercontextid", tabToOpen.getAttribute("usercontextid")); - } - } - gBrowser.updateBrowserRemoteness(initBrowser, gMultiProcessBrowser); }); @@ -1133,13 +1110,6 @@ var gBrowserInit = { // make sure it has a docshell gBrowser.docShell; - // We must set usercontextid before updateBrowserRemoteness() - // so that the newly created remote tab child has correct usercontextid - if (tabToOpen.hasAttribute("usercontextid")) { - let usercontextid = tabToOpen.getAttribute("usercontextid"); - gBrowser.selectedBrowser.setAttribute("usercontextid", usercontextid); - } - // If the browser that we're swapping in was remote, then we'd better // be able to support remote browsers, and then make our selectedTab // remote. @@ -1165,9 +1135,8 @@ var gBrowserInit = { // [3]: postData (nsIInputStream) // [4]: allowThirdPartyFixup (bool) // [5]: referrerPolicy (int) - // [6]: userContextId (int) - // [7]: originPrincipal (nsIPrincipal) - // [8]: triggeringPrincipal (nsIPrincipal) + // [6]: originPrincipal (nsIPrincipal) + // [7]: triggeringPrincipal (nsIPrincipal) else if (window.arguments.length >= 3) { let referrerURI = window.arguments[2]; if (typeof(referrerURI) == "string") { @@ -1179,13 +1148,11 @@ var gBrowserInit = { } let referrerPolicy = (window.arguments[5] != undefined ? window.arguments[5] : Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT); - let userContextId = (window.arguments[6] != undefined ? - window.arguments[6] : Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID); loadURI(uriToLoad, referrerURI, window.arguments[3] || null, - window.arguments[4] || false, referrerPolicy, userContextId, + window.arguments[4] || false, referrerPolicy, // pass the origin principal (if any) and force its use to create // an initial about:blank viewer if present: - window.arguments[7], !!window.arguments[7], window.arguments[8]); + window.arguments[6], !!window.arguments[6], window.arguments[7]); window.focus(); } // Note: loadOneOrMoreURIs *must not* be called if window.arguments.length >= 3. @@ -2070,7 +2037,7 @@ function BrowserTryToCloseWindow() } function loadURI(uri, referrer, postData, allowThirdPartyFixup, referrerPolicy, - userContextId, originPrincipal, forceAboutBlankViewerInCurrent, + originPrincipal, forceAboutBlankViewerInCurrent, triggeringPrincipal) { try { openLinkIn(uri, "current", @@ -2078,7 +2045,6 @@ function loadURI(uri, referrer, postData, allowThirdPartyFixup, referrerPolicy, referrerPolicy: referrerPolicy, postData: postData, allowThirdPartyFixup: allowThirdPartyFixup, - userContextId: userContextId, originPrincipal, triggeringPrincipal, forceAboutBlankViewerInCurrent, @@ -3951,66 +3917,6 @@ function updateEditUIVisibility() } /** - * Opens a new tab with the userContextId specified as an attribute of - * sourceEvent. This attribute is propagated to the top level originAttributes - * living on the tab's docShell. - * - * @param event - * A click event on a userContext File Menu option - */ -function openNewUserContextTab(event) -{ - openUILinkIn(BROWSER_NEW_TAB_URL, "tab", { - userContextId: parseInt(event.target.getAttribute('data-usercontextid')), - }); -} - -/** - * 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. */ @@ -4690,7 +4596,6 @@ nsBrowserAccess.prototype = { _openURIInNewTab: function(aURI, aReferrer, aReferrerPolicy, aIsPrivate, aIsExternal, aForceNotRemote=false, - aUserContextId=Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID, aOpener = null, aTriggeringPrincipal = null) { let win, needToFocusWin; @@ -4719,7 +4624,6 @@ nsBrowserAccess.prototype = { triggeringPrincipal: aTriggeringPrincipal, referrerURI: aReferrer, referrerPolicy: aReferrerPolicy, - userContextId: aUserContextId, fromExternal: aIsExternal, inBackground: loadInBackground, forceNotRemote: aForceNotRemote, @@ -4796,13 +4700,10 @@ nsBrowserAccess.prototype = { // will do the job of shuttling off the newly opened browser to run in // the right process once it starts loading a URI. let forceNotRemote = !!aOpener; - let userContextId = aOpener && aOpener.document - ? aOpener.document.nodePrincipal.originAttributes.userContextId - : Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID; let openerWindow = (aFlags & Ci.nsIBrowserDOMWindow.OPEN_NO_OPENER) ? null : aOpener; let browser = this._openURIInNewTab(aURI, referrer, referrerPolicy, isPrivate, isExternal, - forceNotRemote, userContextId, + forceNotRemote, openerWindow, triggeringPrincipal); if (browser) newWindow = browser.contentWindow; @@ -4834,16 +4735,10 @@ nsBrowserAccess.prototype = { var isExternal = !!(aFlags & Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL); - var userContextId = aParams.openerOriginAttributes && - ("userContextId" in aParams.openerOriginAttributes) - ? aParams.openerOriginAttributes.userContextId - : Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID - let browser = this._openURIInNewTab(aURI, aParams.referrer, aParams.referrerPolicy, aParams.isPrivate, isExternal, false, - userContextId, null, aParams.triggeringPrincipal); if (browser) return browser.QueryInterface(Ci.nsIFrameLoaderOwner); @@ -5400,11 +5295,6 @@ function handleLinkClick(event, href, linkNode) { triggeringPrincipal: doc.nodePrincipal, }; - // The new tab/window must use the same userContextId - if (doc.nodePrincipal.originAttributes.userContextId) { - params.userContextId = doc.nodePrincipal.originAttributes.userContextId; - } - openLinkIn(href, where, params); event.preventDefault(); return true; @@ -5476,8 +5366,6 @@ function handleDroppedLink(event, urlOrLinks, name) let lastLocationChange = gBrowser.selectedBrowser.lastLocationChange; - let userContextId = gBrowser.selectedBrowser.getAttribute("usercontextid"); - // event is null if links are dropped in content process. // inBackground should be false, as it's loading into current browser. let inBackground = false; @@ -5501,7 +5389,6 @@ function handleDroppedLink(event, urlOrLinks, name) replace: true, allowThirdPartyFixup: false, postDatas, - userContextId, }); } }); diff --git a/application/basilisk/base/content/browser.xul b/application/basilisk/base/content/browser.xul index be64f1bac6..0cc4c982ab 100644 --- a/application/basilisk/base/content/browser.xul +++ b/application/basilisk/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/application/basilisk/base/content/content.js b/application/basilisk/base/content/content.js index 5accbdf7b7..d2a70ba117 100644 --- a/application/basilisk/base/content/content.js +++ b/application/basilisk/base/content/content.js @@ -162,9 +162,6 @@ var handleContentContextMenu = function (event) { let selectionInfo = BrowserUtils.getSelectionDetails(content); - let loadContext = docShell.QueryInterface(Ci.nsILoadContext); - let userContextId = loadContext.originAttributes.userContextId; - if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) { let editFlags = SpellCheckHelper.isEditable(event.target, content); let spellInfo; @@ -188,7 +185,7 @@ var handleContentContextMenu = function (event) { principal, docLocation, charSet, baseURI, referrer, referrerPolicy, contentType, contentDisposition, frameOuterWindowID, selectionInfo, disableSetDesktopBg, - loginFillInfo, parentAllowsMixedContent, userContextId }, + loginFillInfo, parentAllowsMixedContent }, { event, popupNode: event.target }); } else { @@ -212,7 +209,6 @@ var handleContentContextMenu = function (event) { disableSetDesktopBackground: disableSetDesktopBg, loginFillInfo, parentAllowsMixedContent, - userContextId, }; } } diff --git a/application/basilisk/base/content/nsContextMenu.js b/application/basilisk/base/content/nsContextMenu.js index 3f77dcb90f..74a2e7a8ee 100644 --- a/application/basilisk/base/content/nsContextMenu.js +++ b/application/basilisk/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"); @@ -142,28 +141,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); }, @@ -958,13 +940,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; }, @@ -982,7 +957,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; @@ -1003,7 +978,6 @@ nsContextMenu.prototype = { let params = { allowMixedContent: persistAllowMixedContentInChildTab, - userContextId: parseInt(event.target.getAttribute('data-usercontextid')), }; openLinkIn(this.linkURL, "tab", this._openLinkInParameters(params)); @@ -1779,8 +1753,4 @@ nsContextMenu.prototype = { menuItem.label = menuLabel; menuItem.accessKey = gNavigatorBundle.getString("contextMenuSearch.accesskey"); }, - createContainerMenu: function(aEvent) { - return createUserContextMenu(aEvent, true, - gContextMenuContentData.userContextId); - }, }; diff --git a/application/basilisk/base/content/tab-content.js b/application/basilisk/base/content/tab-content.js index 7441b21401..35ef8ceb28 100644 --- a/application/basilisk/base/content/tab-content.js +++ b/application/basilisk/base/content/tab-content.js @@ -886,33 +886,6 @@ var RefreshBlocker = { RefreshBlocker.init(); -var UserContextIdNotifier = { - init() { - addEventListener("DOMWindowCreated", this); - }, - - uninit() { - removeEventListener("DOMWindowCreated", this); - }, - - handleEvent(aEvent) { - // When the window is created, we want to inform the tabbrowser about - // the userContextId in use in order to update the UI correctly. - // Just because we cannot change the userContextId from an active docShell, - // we don't need to check DOMContentLoaded again. - this.uninit(); - - // We use the docShell because content.document can have been loaded before - // setting the originAttributes. - let loadContext = docShell.QueryInterface(Ci.nsILoadContext); - let userContextId = loadContext.originAttributes.userContextId; - - sendAsyncMessage("Browser:WindowCreated", { userContextId }); - } -}; - -UserContextIdNotifier.init(); - addMessageListener("AllowScriptsToClose", () => { content.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDOMWindowUtils) diff --git a/application/basilisk/base/content/tabbrowser.xml b/application/basilisk/base/content/tabbrowser.xml index 52c51db690..c2f02512dc 100644 --- a/application/basilisk/base/content/tabbrowser.xml +++ b/application/basilisk/base/content/tabbrowser.xml @@ -814,10 +814,8 @@ } let unifiedComplete = this.mTabBrowser._unifiedComplete; - let userContextId = this.mBrowser.getAttribute("usercontextid") || 0; if (this.mBrowser.registeredOpenURI) { - unifiedComplete.unregisterOpenPage(this.mBrowser.registeredOpenURI, - userContextId); + unifiedComplete.unregisterOpenPage(this.mBrowser.registeredOpenURI); delete this.mBrowser.registeredOpenURI; } // Tabs in private windows aren't registered as "Open" so @@ -825,7 +823,7 @@ if (!isBlankPageURL(aLocation.spec) && (!PrivateBrowsingUtils.isWindowPrivate(window) || PrivateBrowsingUtils.permanentPrivateBrowsing)) { - unifiedComplete.registerOpenPage(aLocation, userContextId); + unifiedComplete.registerOpenPage(aLocation); this.mBrowser.registeredOpenURI = aLocation; } } @@ -1230,7 +1228,6 @@ this._adjustFocusAfterTabSwitch(this.mCurrentTab); } - updateUserContextUIIndicator(); gIdentityHandler.updateSharingIndicator(); this.tabContainer._setPositionalAttributes(); @@ -1486,7 +1483,6 @@ var aSkipAnimation; var aForceNotRemote; var aNoReferrer; - var aUserContextId; var aRelatedBrowser; var aOriginPrincipal; var aOpener; @@ -1507,7 +1503,6 @@ aSkipAnimation = params.skipAnimation; aForceNotRemote = params.forceNotRemote; aNoReferrer = params.noReferrer; - aUserContextId = params.userContextId; aRelatedBrowser = params.relatedBrowser; aOriginPrincipal = params.originPrincipal; aOpener = params.opener; @@ -1530,7 +1525,6 @@ allowMixedContent: aAllowMixedContent, forceNotRemote: aForceNotRemote, noReferrer: aNoReferrer, - userContextId: aUserContextId, originPrincipal: aOriginPrincipal, relatedBrowser: aRelatedBrowser, opener: aOpener }); @@ -1551,7 +1545,6 @@ let aTargetTab; let aNewIndex = -1; let aPostDatas = []; - let aUserContextId; if (arguments.length == 2 && typeof arguments[1] == "object") { let params = arguments[1]; @@ -1562,7 +1555,6 @@ aNewIndex = typeof params.newIndex === "number" ? params.newIndex : aNewIndex; aPostDatas = params.postDatas || aPostDatas; - aUserContextId = params.userContextId; } if (!aURIs.length) @@ -1611,8 +1603,7 @@ ownerTab: owner, skipAnimation: multiple, allowThirdPartyFixup: aAllowThirdPartyFixup, - postData: aPostDatas[0], - userContextId: aUserContextId + postData: aPostDatas[0] }); if (aNewIndex !== -1) { this.moveTabTo(firstTabAdded, aNewIndex); @@ -1625,8 +1616,7 @@ let tab = this.addTab(aURIs[i], { skipAnimation: true, allowThirdPartyFixup: aAllowThirdPartyFixup, - postData: aPostDatas[i], - userContextId: aUserContextId + postData: aPostDatas[i] }); if (targetTabIndex !== -1) this.moveTabTo(tab, ++tabNum); @@ -1899,7 +1889,7 @@ <body> <![CDATA[ // Supported parameters: - // userContextId, remote, isPreloadBrowser, uriIsAboutBlank, permanentKey + // remote, isPreloadBrowser, uriIsAboutBlank, permanentKey const NS_XUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; @@ -1911,10 +1901,6 @@ b.setAttribute("contextmenu", this.getAttribute("contentcontextmenu")); b.setAttribute("tooltip", this.getAttribute("contenttooltip")); - if (aParams.userContextId) { - b.setAttribute("usercontextid", aParams.userContextId); - } - if (aParams.remote) { b.setAttribute("remote", "true"); } @@ -1993,7 +1979,7 @@ "use strict"; // Supported parameters: - // forceNotRemote, userContextId + // forceNotRemote let uriIsAboutBlank = !aURI || aURI == "about:blank"; @@ -2011,7 +1997,6 @@ // Private windows are not included because both the label and the // icon for the tab would be set incorrectly (see bug 1195981). if (aURI == BROWSER_NEW_TAB_URL && - !aParams.userContextId && !PrivateBrowsingUtils.isWindowPrivate(window)) { browser = this._getPreloadedBrowser(); if (browser) { @@ -2025,7 +2010,6 @@ browser = this._createBrowser({permanentKey: aTab.permanentKey, remote: remote, uriIsAboutBlank: uriIsAboutBlank, - userContextId: aParams.userContextId, relatedBrowser: aParams.relatedBrowser, opener: aParams.opener}); } @@ -2100,7 +2084,6 @@ var aAllowMixedContent; var aForceNotRemote; var aNoReferrer; - var aUserContextId; var aEventDetail; var aRelatedBrowser; var aOriginPrincipal; @@ -2123,7 +2106,6 @@ aAllowMixedContent = params.allowMixedContent; aForceNotRemote = params.forceNotRemote; aNoReferrer = params.noReferrer; - aUserContextId = params.userContextId; aEventDetail = params.eventDetail; aRelatedBrowser = params.relatedBrowser; aOriginPrincipal = params.originPrincipal; @@ -2150,11 +2132,6 @@ t.setAttribute("label", aURI); } - if (aUserContextId) { - t.setAttribute("usercontextid", aUserContextId); - ContextualIdentityService.setTabStyle(t); - } - t.setAttribute("crop", "end"); t.setAttribute("onerror", "this.removeAttribute('image');"); @@ -2204,7 +2181,6 @@ // of tab.linkedBrowser. let browserParams = { forceNotRemote: aForceNotRemote, - userContextId: aUserContextId, relatedBrowser: aRelatedBrowser, opener: aOpener, }; @@ -2583,8 +2559,7 @@ listener.destroy(); if (browser.registeredOpenURI && !aAdoptedByTab) { - this._unifiedComplete.unregisterOpenPage(browser.registeredOpenURI, - browser.getAttribute("usercontextid") || 0); + this._unifiedComplete.unregisterOpenPage(browser.registeredOpenURI); delete browser.registeredOpenURI; } @@ -2783,11 +2758,6 @@ if (ourBrowser.isRemoteBrowser != otherBrowser.isRemoteBrowser) return; - // Keep the userContextId if set on other browser - if (otherBrowser.hasAttribute("usercontextid")) { - ourBrowser.setAttribute("usercontextid", otherBrowser.getAttribute("usercontextid")); - } - // That's gBrowser for the other window, not the tab's browser! var remoteBrowser = aOtherTab.ownerDocument.defaultView.gBrowser; var isPending = aOtherTab.hasAttribute("pending"); @@ -2820,10 +2790,6 @@ aOurTab.setAttribute("soundplaying", "true"); modifiedAttrs.push("soundplaying"); } - if (aOtherTab.hasAttribute("usercontextid")) { - aOurTab.setUserContextId(aOtherTab.getAttribute("usercontextid")); - modifiedAttrs.push("usercontextid"); - } if (aOtherTab.hasAttribute("sharing")) { aOurTab.setAttribute("sharing", aOtherTab.getAttribute("sharing")); modifiedAttrs.push("sharing"); @@ -2961,8 +2927,7 @@ <![CDATA[ // If the current URI is registered as open remove it from the list. if (aOurBrowser.registeredOpenURI) { - this._unifiedComplete.unregisterOpenPage(aOurBrowser.registeredOpenURI, - aOurBrowser.getAttribute("usercontextid") || 0); + this._unifiedComplete.unregisterOpenPage(aOurBrowser.registeredOpenURI); delete aOurBrowser.registeredOpenURI; } @@ -3302,10 +3267,6 @@ // it in the other window (making it seem to have moved between // windows). let params = { eventDetail: { adoptedTab: aTab } }; - if (aTab.hasAttribute("usercontextid")) { - // new tab must have the same usercontextid as the old one - params.userContextId = aTab.getAttribute("usercontextid"); - } let newTab = this.addTab("about:blank", params); let newBrowser = this.getBrowserForTab(newTab); let newURL = aTab.linkedBrowser.currentURI.spec; @@ -4625,7 +4586,6 @@ disableSetDesktopBackground: data.disableSetDesktopBg, loginFillInfo: data.loginFillInfo, parentAllowsMixedContent: data.parentAllowsMixedContent, - userContextId: data.userContextId, }; let popup = browser.ownerDocument.getElementById("contentAreaContextMenu"); let event = gContextMenuContentData.event; @@ -4652,17 +4612,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; } case "Findbar:Keypress": { @@ -4845,8 +4794,7 @@ for (let tab of this.tabs) { let browser = tab.linkedBrowser; if (browser.registeredOpenURI) { - this._unifiedComplete.unregisterOpenPage(browser.registeredOpenURI, - browser.getAttribute("usercontextid") || 0); + this._unifiedComplete.unregisterOpenPage(browser.registeredOpenURI); delete browser.registeredOpenURI; } let filter = this._tabFilters.get(tab); @@ -5247,7 +5195,7 @@ </xul:arrowscrollbox> </content> - <implementation implements="nsIDOMEventListener, nsIObserver"> + <implementation implements="nsIDOMEventListener"> <constructor> <![CDATA[ this.mTabClipWidth = Services.prefs.getIntPref("browser.tabs.tabClipWidth"); @@ -5266,17 +5214,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> @@ -5302,55 +5242,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; @@ -6451,7 +6342,6 @@ inBackground = !inBackground; let targetTab = this._getDragTargetTab(event, true); - let userContextId = this.selectedItem.getAttribute("usercontextid"); let replace = !!targetTab; let newIndex = this._getDropIndex(event, true); let urls = links.map(link => link.url); @@ -6461,7 +6351,6 @@ allowThirdPartyFixup: true, targetTab, newIndex, - userContextId, }); } @@ -6722,14 +6611,6 @@ --> <field name="muteReason">undefined</field> - <property name="userContextId" readonly="true"> - <getter> - return this.hasAttribute("usercontextid") - ? parseInt(this.getAttribute("usercontextid")) - : 0; - </getter> - </property> - <property name="soundPlaying" readonly="true"> <getter> return this.getAttribute("soundplaying") == "true"; @@ -6857,27 +6738,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> @@ -7054,30 +6914,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); @@ -7094,9 +6933,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--) { @@ -7105,9 +6941,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/application/basilisk/base/content/utilityOverlay.js b/application/basilisk/base/content/utilityOverlay.js index c576aef9ed..f3ebf3b7eb 100644 --- a/application/basilisk/base/content/utilityOverlay.js +++ b/application/basilisk/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"); @@ -166,7 +165,6 @@ function whereToOpenLink( e, ignoreButton, ignoreAlt ) * skipTabAnimation (boolean) * allowPinnedTabHostChange (boolean) * allowPopups (boolean) - * userContextId (unsigned int) */ function openUILinkIn(url, where, aAllowThirdPartyFixup, aPostData, aReferrerURI) { var params; @@ -212,7 +210,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; @@ -258,7 +255,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); @@ -305,17 +301,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); @@ -408,8 +399,7 @@ function openLinkIn(url, where, params) { flags: flags, referrerURI: aNoReferrer ? null : aReferrerURI, referrerPolicy: aReferrerPolicy, - postData: aPostData, - userContextId: aUserContextId + postData: aPostData }); browserUsedForLoad = aCurrentBrowser; break; @@ -428,7 +418,6 @@ function openLinkIn(url, where, params) { skipAnimation: aSkipTabAnimation, allowMixedContent: aAllowMixedContent, noReferrer: aNoReferrer, - userContextId: aUserContextId, originPrincipal: aPrincipal, triggeringPrincipal: aTriggeringPrincipal, }); @@ -472,74 +461,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/application/basilisk/components/contextualidentity/content/usercontext.css b/application/basilisk/components/contextualidentity/content/usercontext.css deleted file mode 100644 index 728275d9f8..0000000000 --- a/application/basilisk/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/application/basilisk/components/contextualidentity/jar.mn b/application/basilisk/components/contextualidentity/jar.mn deleted file mode 100644 index 848245949a..0000000000 --- a/application/basilisk/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/application/basilisk/components/contextualidentity/moz.build b/application/basilisk/components/contextualidentity/moz.build deleted file mode 100644 index aac3a838c4..0000000000 --- a/application/basilisk/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/application/basilisk/components/customizableui/CustomizableWidgets.jsm b/application/basilisk/components/customizableui/CustomizableWidgets.jsm index 09b3f167e3..401b7ca747 100644 --- a/application/basilisk/components/customizableui/CustomizableWidgets.jsm +++ b/application/basilisk/components/customizableui/CustomizableWidgets.jsm @@ -23,8 +23,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "CharsetMenu", "resource://gre/modules/CharsetMenu.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", "resource://gre/modules/PrivateBrowsingUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService", - "resource://gre/modules/ContextualIdentityService.jsm"); XPCOMUtils.defineLazyGetter(this, "CharsetBundle", function() { const kCharsetBundle = "chrome://global/locale/charsetMenu.properties"; @@ -977,89 +975,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/application/basilisk/components/moz.build b/application/basilisk/components/moz.build index a7685cbfca..65e8beb761 100644 --- a/application/basilisk/components/moz.build +++ b/application/basilisk/components/moz.build @@ -6,7 +6,6 @@ DIRS += [ 'about', - 'contextualidentity', 'customizableui', 'dirprovider', 'downloads', diff --git a/application/basilisk/components/preferences/containers.js b/application/basilisk/components/preferences/containers.js deleted file mode 100644 index 6ca5853f7f..0000000000 --- a/application/basilisk/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/application/basilisk/components/preferences/containers.xul b/application/basilisk/components/preferences/containers.xul deleted file mode 100644 index 62a775fe40..0000000000 --- a/application/basilisk/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/application/basilisk/components/preferences/cookies.js b/application/basilisk/components/preferences/cookies.js index c420855f89..4ede5b6e63 100644 --- a/application/basilisk/components/preferences/cookies.js +++ b/application/basilisk/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,24 +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") this._handleCookieChanged(aCookie, strippedHost); @@ -498,9 +477,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 +500,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 +511,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 +520,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/application/basilisk/components/preferences/cookies.xul b/application/basilisk/components/preferences/cookies.xul index bd60d9346a..d5fefdef72 100644 --- a/application/basilisk/components/preferences/cookies.xul +++ b/application/basilisk/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/application/basilisk/components/preferences/handlers.css b/application/basilisk/components/preferences/handlers.css index 6af75a08b2..d5f100831e 100644 --- a/application/basilisk/components/preferences/handlers.css +++ b/application/basilisk/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/application/basilisk/components/preferences/handlers.xml b/application/basilisk/components/preferences/handlers.xml index 0c629d7599..ad07a493c0 100644 --- a/application/basilisk/components/preferences/handlers.xml +++ b/application/basilisk/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/application/basilisk/components/preferences/in-content/containers.js b/application/basilisk/components/preferences/in-content/containers.js deleted file mode 100644 index 758e45fffd..0000000000 --- a/application/basilisk/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/application/basilisk/components/preferences/in-content/containers.xul b/application/basilisk/components/preferences/in-content/containers.xul deleted file mode 100644 index e83bac1c35..0000000000 --- a/application/basilisk/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/application/basilisk/components/preferences/in-content/jar.mn b/application/basilisk/components/preferences/in-content/jar.mn index e61a888569..70544f3321 100644 --- a/application/basilisk/components/preferences/in-content/jar.mn +++ b/application/basilisk/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/application/basilisk/components/preferences/in-content/preferences.js b/application/basilisk/components/preferences/in-content/preferences.js index e18ab4b045..35e10c58d3 100644 --- a/application/basilisk/components/preferences/in-content/preferences.js +++ b/application/basilisk/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/application/basilisk/components/preferences/in-content/preferences.xul b/application/basilisk/components/preferences/in-content/preferences.xul index 7ec7ef119c..093516140c 100644 --- a/application/basilisk/components/preferences/in-content/preferences.xul +++ b/application/basilisk/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/application/basilisk/components/preferences/in-content/privacy.js b/application/basilisk/components/preferences/in-content/privacy.js index eab606e364..a976fb4fae 100644 --- a/application/basilisk/components/preferences/in-content/privacy.js +++ b/application/basilisk/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"); @@ -62,59 +60,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. */ @@ -136,7 +81,6 @@ var gPrivacyPane = { this._initTrackingProtectionPBM(); #endif this._initAutocomplete(); - this._initBrowserContainers(); setEventListener("privacy.sanitize.sanitizeOnShutdown", "change", gPrivacyPane._updateSanitizeSettingsButton); @@ -184,10 +128,6 @@ var gPrivacyPane = { setEventListener("changeBlockListPBM", "command", gPrivacyPane.showBlockLists); #endif - setEventListener("browserContainersCheckbox", "command", - gPrivacyPane._checkBrowserContainers); - setEventListener("browserContainersSettings", "command", - gPrivacyPane.showContainerSettings); }, #ifdef MOZ_SAFE_BROWSING @@ -489,13 +429,6 @@ var gPrivacyPane = { }, #endif - /** - * Displays container panel for customising and adding containers. - */ - showContainerSettings() { - gotoPref("containers"); - }, - #ifdef MOZ_SAFE_BROWSING /** * Displays the available block lists for tracking protection. @@ -702,25 +635,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/application/basilisk/components/preferences/in-content/privacy.xul b/application/basilisk/components/preferences/in-content/privacy.xul index e6cdc5dd2c..691cd6bf9b 100644 --- a/application/basilisk/components/preferences/in-content/privacy.xul +++ b/application/basilisk/components/preferences/in-content/privacy.xul @@ -302,28 +302,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/application/basilisk/components/preferences/jar.mn b/application/basilisk/components/preferences/jar.mn index 5b24e89df0..f74be08205 100644 --- a/application/basilisk/components/preferences/jar.mn +++ b/application/basilisk/components/preferences/jar.mn @@ -24,8 +24,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/application/basilisk/components/sessionstore/ContentRestore.jsm b/application/basilisk/components/sessionstore/ContentRestore.jsm index d4972bcafe..8b38676242 100644 --- a/application/basilisk/components/sessionstore/ContentRestore.jsm +++ b/application/basilisk/components/sessionstore/ContentRestore.jsm @@ -208,10 +208,6 @@ ContentRestoreInternal.prototype = { ? Utils.deserializePrincipal(loadArguments.triggeringPrincipal) : null; - if (loadArguments.userContextId) { - webNavigation.setOriginAttributesBeforeLoading({ userContextId: loadArguments.userContextId }); - } - webNavigation.loadURIWithOptions(loadArguments.uri, loadArguments.flags, referrer, referrerPolicy, postData, null, null, triggeringPrincipal); diff --git a/application/basilisk/components/sessionstore/SessionHistory.jsm b/application/basilisk/components/sessionstore/SessionHistory.jsm index 3d28d87db8..907a60839d 100644 --- a/application/basilisk/components/sessionstore/SessionHistory.jsm +++ b/application/basilisk/components/sessionstore/SessionHistory.jsm @@ -64,11 +64,10 @@ var SessionHistoryInternal = { * The docShell that owns the session history. */ collect: function (docShell) { - let loadContext = docShell.QueryInterface(Ci.nsILoadContext); let webNavigation = docShell.QueryInterface(Ci.nsIWebNavigation); let history = webNavigation.sessionHistory.QueryInterface(Ci.nsISHistoryInternal); - let data = {entries: [], userContextId: loadContext.originAttributes.userContextId }; + let data = {entries: []}; if (history && history.count > 0) { // Loop over the transaction linked list directly so we can get the diff --git a/application/basilisk/components/sessionstore/SessionStore.jsm b/application/basilisk/components/sessionstore/SessionStore.jsm index b599bc1627..086bb914a5 100644 --- a/application/basilisk/components/sessionstore/SessionStore.jsm +++ b/application/basilisk/components/sessionstore/SessionStore.jsm @@ -2204,10 +2204,9 @@ var SessionStoreInternal = { } // Create a new tab. - let userContextId = aTab.getAttribute("usercontextid"); let newTab = aTab == aWindow.gBrowser.selectedTab ? - aWindow.gBrowser.addTab(null, {relatedToCurrent: true, ownerTab: aTab, userContextId}) : - aWindow.gBrowser.addTab(null, {userContextId}); + aWindow.gBrowser.addTab(null, {relatedToCurrent: true, ownerTab: aTab}) : + aWindow.gBrowser.addTab(); // Set tab title to "Connecting..." and start the throbber to pretend we're // doing something while actually waiting for data from the frame script. @@ -2296,7 +2295,7 @@ var SessionStoreInternal = { // create a new tab let tabbrowser = aWindow.gBrowser; - let tab = tabbrowser.selectedTab = tabbrowser.addTab(null, state); + let tab = tabbrowser.selectedTab = tabbrowser.addTab(); // restore tab content this.restoreTab(tab, state); @@ -3100,31 +3099,13 @@ var SessionStoreInternal = { let numVisibleTabs = 0; for (var t = 0; t < newTabCount; t++) { - // When trying to restore into existing tab, we also take the userContextId - // into account if present. - let userContextId = winData.tabs[t].userContextId; - let reuseExisting = t < openTabCount && - (tabbrowser.tabs[t].getAttribute("usercontextid") == (userContextId || "")); - // If the tab is pinned, then we'll be loading it right away, and - // there's no need to cause a remoteness flip by loading it initially - // non-remote. - let forceNotRemote = !winData.tabs[t].pinned; - let tab = reuseExisting ? tabbrowser.tabs[t] : - tabbrowser.addTab("about:blank", - {skipAnimation: true, - forceNotRemote, - userContextId, - skipBackgroundNotify: true}); - - // If we inserted a new tab because the userContextId didn't match with the - // open tab, even though `t < openTabCount`, we need to remove that open tab - // and put the newly added tab in its place. - if (!reuseExisting && t < openTabCount) { - tabbrowser.removeTab(tabbrowser.tabs[t]); - tabbrowser.moveTabTo(tab, t); - } - - tabs.push(tab); + tabs.push(t < openTabCount ? + tabbrowser.tabs[t] : + tabbrowser.addTab("about:blank", { + skipAnimation: true, + forceNotRemote: true, + skipBackgroundNotify: true + })); if (winData.tabs[t].pinned) tabbrowser.pinTab(tabs[t]); @@ -3531,9 +3512,6 @@ var SessionStoreInternal = { let uri = activePageData ? activePageData.url || null : null; if (aLoadArguments) { uri = aLoadArguments.uri; - if (aLoadArguments.userContextId) { - browser.setAttribute("usercontextid", aLoadArguments.userContextId); - } } // We have to mark this tab as restoring first, otherwise diff --git a/application/basilisk/components/sessionstore/TabState.jsm b/application/basilisk/components/sessionstore/TabState.jsm index f22c52fe33..ac846031b9 100644 --- a/application/basilisk/components/sessionstore/TabState.jsm +++ b/application/basilisk/components/sessionstore/TabState.jsm @@ -181,10 +181,6 @@ var TabStateInternal = { if (key === "history") { tabData.entries = value.entries; - if (value.hasOwnProperty("userContextId")) { - tabData.userContextId = value.userContextId; - } - if (value.hasOwnProperty("index")) { tabData.index = value.index; } diff --git a/application/basilisk/locales/en-US/chrome/browser/browser.properties b/application/basilisk/locales/en-US/chrome/browser/browser.properties index f1c39839b2..abec30bf19 100644 --- a/application/basilisk/locales/en-US/chrome/browser/browser.properties +++ b/application/basilisk/locales/en-US/chrome/browser/browser.properties @@ -638,37 +638,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/application/basilisk/locales/en-US/chrome/browser/preferences/containers.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/containers.dtd deleted file mode 100644 index 58eca1ace8..0000000000 --- a/application/basilisk/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/application/basilisk/locales/en-US/chrome/browser/preferences/containers.properties b/application/basilisk/locales/en-US/chrome/browser/preferences/containers.properties deleted file mode 100644 index 9866a06595..0000000000 --- a/application/basilisk/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/application/basilisk/locales/en-US/chrome/browser/preferences/cookies.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/cookies.dtd index 5e7df9609a..c83331328e 100644 --- a/application/basilisk/locales/en-US/chrome/browser/preferences/cookies.dtd +++ b/application/basilisk/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/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.dtd index 7702c8c517..353e627d7e 100644 --- a/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.dtd +++ b/application/basilisk/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/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.properties b/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.properties index 84fac427d4..c0b7e1be01 100644 --- a/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.properties +++ b/application/basilisk/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/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd index f743c4040f..8820e92abf 100644 --- a/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd +++ b/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd @@ -110,10 +110,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/application/basilisk/locales/jar.mn b/application/basilisk/locales/jar.mn index 5c5a72a1fb..dfa6d4e000 100644 --- a/application/basilisk/locales/jar.mn +++ b/application/basilisk/locales/jar.mn @@ -79,10 +79,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/application/basilisk/modules/ContentClick.jsm b/application/basilisk/modules/ContentClick.jsm index 40101d5d35..4cd665f8c3 100644 --- a/application/basilisk/modules/ContentClick.jsm +++ b/application/basilisk/modules/ContentClick.jsm @@ -88,11 +88,6 @@ var ContentClick = { triggeringPrincipal: json.triggeringPrincipal, }; - // The new tab/window must use the same userContextId. - if (json.originAttributes.userContextId) { - params.userContextId = json.originAttributes.userContextId; - } - window.openLinkIn(json.href, where, params); } }; diff --git a/application/basilisk/themes/shared/incontentprefs/containers.css b/application/basilisk/themes/shared/incontentprefs/containers.css deleted file mode 100644 index 5446dccce2..0000000000 --- a/application/basilisk/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/application/basilisk/themes/shared/incontentprefs/preferences.inc.css b/application/basilisk/themes/shared/incontentprefs/preferences.inc.css index 0e62660de9..20ea98327e 100644 --- a/application/basilisk/themes/shared/incontentprefs/preferences.inc.css +++ b/application/basilisk/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/application/basilisk/themes/shared/jar.inc.mn b/application/basilisk/themes/shared/jar.inc.mn index 361edd3117..5750d2dc5a 100644 --- a/application/basilisk/themes/shared/jar.inc.mn +++ b/application/basilisk/themes/shared/jar.inc.mn @@ -73,8 +73,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/application/basilisk/themes/shared/preferences/containers.css b/application/basilisk/themes/shared/preferences/containers.css deleted file mode 100644 index 3fb9653316..0000000000 --- a/application/basilisk/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); -} |