Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • gk/tor-browser
  • peterstory/tor-browser
  • sanketh/tor-browser
  • acat/tor-browser
  • sysrqb/tor-browser
  • boklm/tor-browser
  • dan/tor-browser
  • fabrizio/tor-browser
  • victorvw/tor-browser
  • aguestuser/tor-browser
  • WofWca/tor-browser
  • p13dz/tor-browser
  • mwolfe/tor-browser
  • tpo/applications/tor-browser
  • brade/tor-browser
  • pierov/tor-browser
  • ma1/tor-browser
  • JeremyRand/tor-browser
  • henry/tor-browser
  • msimonelli/tor-browser
  • cypherpunks1/tor-browser
  • blackZwork/tor-browser
  • starlingroot/tor-browser
  • cohosh/tor-browser
  • t-m-w/tor-browser
  • trinity-1686a/tor-browser
  • HHN/tor-browser
  • emmapeel/tor-browser
  • Achintya_Sharma/tor-browser
  • guest475646844/tor-browser
  • Mima/tor-browser
  • morgan/tor-browser
  • clairehurst/tor-browser
  • NoisyCoil/tor-browser
  • gus/tor-browser
  • Francewhoa/tor-browser
  • novialriptide/tor-browser
  • jwilde/tor-browser
  • brizental/tor-browser
  • ourhopeforfreedom/tor-browser
  • onyinyang/tor-browser
  • Noino/tor-browser
  • murmelurmel/tor-browser
43 results
Show changes
Showing
with 327 additions and 137 deletions
......@@ -48,7 +48,6 @@ ChromeUtils.defineESModuleGetters(this, {
PromptUtils: "resource://gre/modules/PromptUtils.sys.mjs",
ReaderMode: "resource://gre/modules/ReaderMode.sys.mjs",
Sanitizer: "resource:///modules/Sanitizer.sys.mjs",
SaveToPocket: "chrome://pocket/content/SaveToPocket.sys.mjs",
ScreenshotsUtils: "resource:///modules/ScreenshotsUtils.sys.mjs",
SearchUIUtils: "resource:///modules/SearchUIUtils.sys.mjs",
SessionStartup: "resource:///modules/sessionstore/SessionStartup.sys.mjs",
......@@ -237,6 +236,16 @@ XPCOMUtils.defineLazyScriptGetter(
["DownloadsButton", "DownloadsIndicatorView"],
"chrome://browser/content/downloads/indicator.js"
);
XPCOMUtils.defineLazyScriptGetter(
this,
["SecurityLevelButton"],
"chrome://browser/content/securitylevel/securityLevel.js"
);
XPCOMUtils.defineLazyScriptGetter(
this,
["NewIdentityButton"],
"chrome://browser/content/newidentity.js"
);
XPCOMUtils.defineLazyScriptGetter(
this,
"gEditItemOverlay",
......@@ -1673,6 +1682,12 @@ var gBrowserInit = {
// doesn't flicker as the window is being shown.
DownloadsButton.init();
// Init the SecuritySettingsButton
SecurityLevelButton.init();
// Init the NewIdentityButton
NewIdentityButton.init();
// Certain kinds of automigration rely on this notification to complete
// their tasks BEFORE the browser window is shown. SessionStore uses it to
// restore tabs into windows AFTER important parts like gMultiProcessBrowser
......@@ -2443,6 +2458,10 @@ var gBrowserInit = {
DownloadsButton.uninit();
SecurityLevelButton.uninit();
NewIdentityButton.uninit();
if (gToolbarKeyNavEnabled) {
ToolbarKeyboardNavigator.uninit();
}
......@@ -4736,6 +4755,10 @@ let gShareUtils = {
* Updates a sharing item in a given menu, creating it if necessary.
*/
updateShareURLMenuItem(browser, insertAfterEl) {
if (!Services.prefs.getBoolPref("browser.menu.share_url.allow", true)) {
return;
}
// We only support "share URL" on macOS and on Windows 10:
if (
AppConstants.platform != "macosx" &&
......@@ -5302,8 +5325,6 @@ var XULBrowserWindow = {
SafeBrowsingNotificationBox.onLocationChange(aLocationURI);
SaveToPocket.onLocationChange(window);
let originalURI;
if (aRequest instanceof Ci.nsIChannel) {
originalURI = aRequest.originalURI;
......
......@@ -20,6 +20,8 @@
<?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/tabbrowser.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/downloads/downloads.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/securitylevel/securityLevelPanel.css"?>
<?xml-stylesheet href="chrome://browser/content/securitylevel/securityLevelButton.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"?>
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
......@@ -85,6 +87,7 @@
<link rel="localization" href="toolkit/branding/brandings.ftl"/>
<link rel="localization" href="toolkit/global/textActions.ftl"/>
<link rel="localization" href="toolkit/printing/printUI.ftl"/>
<link rel="localization" href="browser/languageNotification.ftl"/>
<!-- Untranslated FTL files -->
<link rel="localization" href="locales-preview/translations.ftl" />
<link rel="localization" href="preview/firefoxSuggest.ftl" />
......@@ -119,6 +122,7 @@
Services.scriptloader.loadSubScript("chrome://browser/content/places/places-menupopup.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/search/autocomplete-popup.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/search/searchbar.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/languageNotification.js", this);
window.onload = gBrowserInit.onLoad.bind(gBrowserInit);
window.onunload = gBrowserInit.onUnload.bind(gBrowserInit);
......
"use strict";
// Show a prompt to suggest to the user that they can change the UI language.
// Show it only the first time, and then do not show it anymore
window.addEventListener("load", async () => {
const PREF_NAME = "intl.language_notification.shown";
if (Services.prefs.getBoolPref(PREF_NAME, false)) {
return;
}
// Already customized, we do not suggest to change it again...
if (Services.prefs.getCharPref("intl.locale.requested", "") !== "") {
// ... and we never show the notification, either
Services.prefs.setBoolPref(PREF_NAME, true);
return;
}
// In sync with our changes on browser/components/preferences/main.js for
// tor-browser#41369 and tor-browser#41372.
const code =
Services.locale.appLocaleAsBCP47 === "ja-JP-macos"
? "ja"
: Services.locale.appLocaleAsBCP47;
const language = Services.intl
.getLocaleDisplayNames(undefined, [code], { preferNative: true })[0]
.replace(/\s*\(.+\)$/g, "");
// We want to determine whether the current locale was chosen based on the
// system locales, in which case langauge negotiation returns a match, or
// whether it simply defaulted to en-US.
const matchingSystem = !!Services.locale.negotiateLanguages(
// Since intl.locale.requested is empty, we expect requestedLocales to match
// the user's system locales.
Services.locale.requestedLocales,
Services.locale.availableLocales
).length;
const label = await document.l10n.formatValue(
matchingSystem
? "language-notification-label-system"
: "language-notification-label",
{ language }
);
const buttons = [
{
"l10n-id": "language-notification-button",
callback() {
openPreferences("general-language");
},
},
];
gNotificationBox.appendNotification(
"language-notification",
{
label,
priority: gNotificationBox.PRIORITY_INFO_HIGH,
},
buttons
);
// We do not wait for the user to either click on the button or dismiss the
// notification: after we have shown it once, we take for granted that the
// user has seen it and we never show it again.
Services.prefs.setBoolPref(PREF_NAME, true);
});
......@@ -527,6 +527,7 @@
#include ../../components/downloads/content/downloadsPanel.inc.xhtml
#include ../../components/translations/content/translationsPanel.inc.xhtml
#include ../../../devtools/startup/enableDevToolsPopup.inc.xhtml
#include ../../components/securitylevel/content/securityLevelPanel.inc.xhtml
#include browser-allTabsMenu.inc.xhtml
<tooltip id="dynamic-shortcut-tooltip"
......
......@@ -440,6 +440,8 @@
</box>
</toolbarbutton>
#include ../../components/securitylevel/content/securityLevelButton.inc.xhtml
<toolbarbutton id="fxa-toolbar-menu-button" class="toolbarbutton-1 chromeclass-toolbar-additional subviewbutton-nav"
badged="true"
delegatesanchor="true"
......@@ -586,6 +588,8 @@
ondragover="newWindowButtonObserver.onDragOver(event)"
ondragenter="newWindowButtonObserver.onDragOver(event)"/>
<toolbarbutton id="new-identity-button" class="toolbarbutton-1 chromeclass-toolbar-additional"/>
<toolbarbutton id="fullscreen-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
observes="View:FullScreen"
type="checkbox"
......
......@@ -105,5 +105,4 @@ browser.jar:
content/browser/spotlight.js (content/spotlight.js)
* content/browser/default-bookmarks.html (content/default-bookmarks.html)
# L10n resources and overrides.
% override chrome://global/locale/appstrings.properties chrome://browser/locale/appstrings.properties
content/browser/languageNotification.js (content/languageNotification.js)
......@@ -88,4 +88,7 @@ if CONFIG["OS_ARCH"] == "WINNT" and CONFIG["MOZ_DEFAULT_BROWSER_AGENT"]:
# Impacts `/toolkit/content/license.html`.
DEFINES["MOZ_DEFAULT_BROWSER_AGENT"] = True
if CONFIG["BASE_BROWSER_UPDATE"]:
DEFINES["BASE_BROWSER_UPDATE"] = True
JAR_MANIFESTS += ["jar.mn"]
......@@ -42,6 +42,9 @@ XPCOMUtils.defineLazyGetter(lazy, "gWindowsAlertsService", () => {
?.QueryInterface(Ci.nsIWindowsAlertsService);
});
const FORK_VERSION_PREF =
"browser.startup.homepage_override.basebrowser.version";
// One-time startup homepage override configurations
const ONCE_DOMAINS = ["mozilla.org", "firefox.com"];
const ONCE_PREF = "browser.startup.homepage_override.once";
......@@ -105,7 +108,8 @@ const OVERRIDE_NEW_BUILD_ID = 3;
* Returns:
* OVERRIDE_NEW_PROFILE if this is the first run with a new profile.
* OVERRIDE_NEW_MSTONE if this is the first run with a build with a different
* Gecko milestone (i.e. right after an upgrade).
* Gecko milestone or fork version (i.e. right after an
* upgrade).
* OVERRIDE_NEW_BUILD_ID if this is the first run with a new build ID of the
* same Gecko milestone (i.e. after a nightly upgrade).
* OVERRIDE_NONE otherwise.
......@@ -122,6 +126,8 @@ function needHomepageOverride(prefb) {
var mstone = Services.appinfo.platformVersion;
var savedForkVersion = prefb.getCharPref(FORK_VERSION_PREF, null);
var savedBuildID = prefb.getCharPref(
"browser.startup.homepage_override.buildID",
""
......@@ -143,9 +149,16 @@ function needHomepageOverride(prefb) {
prefb.setCharPref("browser.startup.homepage_override.mstone", mstone);
prefb.setCharPref("browser.startup.homepage_override.buildID", buildID);
prefb.setCharPref(FORK_VERSION_PREF, AppConstants.BASE_BROWSER_VERSION);
return savedmstone ? OVERRIDE_NEW_MSTONE : OVERRIDE_NEW_PROFILE;
}
if (AppConstants.BASE_BROWSER_VERSION != savedForkVersion) {
prefb.setCharPref("browser.startup.homepage_override.buildID", buildID);
prefb.setCharPref(FORK_VERSION_PREF, AppConstants.BASE_BROWSER_VERSION);
return OVERRIDE_NEW_MSTONE;
}
if (buildID != savedBuildID) {
prefb.setCharPref("browser.startup.homepage_override.buildID", buildID);
return OVERRIDE_NEW_BUILD_ID;
......@@ -671,6 +684,10 @@ nsBrowserContentHandler.prototype = {
"browser.startup.homepage_override.buildID",
"unknown"
);
// We do the same for the fork version.
let old_forkVersion = prefb.getCharPref(FORK_VERSION_PREF, null);
override = needHomepageOverride(prefb);
if (override != OVERRIDE_NONE) {
switch (override) {
......@@ -686,8 +703,8 @@ nsBrowserContentHandler.prototype = {
additionalPage = Services.urlFormatter.formatURLPref(
"startup.homepage_welcome_url.additional"
);
// Turn on 'later run' pages for new profiles.
lazy.LaterRun.enabled = true;
// Disable 'later run' pages for new profiles (tor-browser#41568)
lazy.LaterRun.enabled = false;
break;
case OVERRIDE_NEW_MSTONE:
// Check whether we will restore a session. If we will, we assume
......@@ -701,9 +718,10 @@ nsBrowserContentHandler.prototype = {
"startup.homepage_override_url"
);
let update = lazy.UpdateManager.readyUpdate;
let old_version = old_forkVersion ? old_forkVersion : old_mstone;
if (
update &&
Services.vc.compare(update.appVersion, old_mstone) > 0
Services.vc.compare(update.appVersion, old_version) > 0
) {
overridePage = getPostUpdateOverridePage(update, overridePage);
// Send the update ping to signal that the update was successful.
......@@ -711,6 +729,10 @@ nsBrowserContentHandler.prototype = {
}
overridePage = overridePage.replace("%OLD_VERSION%", old_mstone);
overridePage = overridePage.replace(
"%OLD_BASE_BROWSER_VERSION%",
old_forkVersion
);
break;
case OVERRIDE_NEW_BUILD_ID:
if (lazy.UpdateManager.readyUpdate) {
......
......@@ -62,7 +62,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
"resource://gre/modules/psm/RemoteSecuritySettings.sys.mjs",
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
SaveToPocket: "chrome://pocket/content/SaveToPocket.sys.mjs",
ScreenshotsUtils: "resource:///modules/ScreenshotsUtils.sys.mjs",
SearchSERPTelemetry: "resource:///modules/SearchSERPTelemetry.sys.mjs",
SessionStartup: "resource:///modules/sessionstore/SessionStartup.sys.mjs",
......@@ -84,11 +83,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
AboutNewTab: "resource:///modules/AboutNewTab.jsm",
AddonManager: "resource://gre/modules/AddonManager.jsm",
ASRouterDefaultConfig:
"resource://activity-stream/lib/ASRouterDefaultConfig.jsm",
ASRouterNewTabHook: "resource://activity-stream/lib/ASRouterNewTabHook.jsm",
ASRouter: "resource://activity-stream/lib/ASRouter.jsm",
Blocklist: "resource://gre/modules/Blocklist.jsm",
BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.jsm",
......@@ -267,31 +262,6 @@ let JSWINDOWACTORS = {
matches: ["about:messagepreview", "about:messagepreview?*"],
},
AboutNewTab: {
parent: {
esModuleURI: "resource:///actors/AboutNewTabParent.sys.mjs",
},
child: {
esModuleURI: "resource:///actors/AboutNewTabChild.sys.mjs",
events: {
DOMDocElementInserted: {},
DOMContentLoaded: {},
load: { capture: true },
unload: { capture: true },
pageshow: {},
visibilitychange: {},
},
},
// The wildcard on about:newtab is for the ?endpoint query parameter
// that is used for snippets debugging. The wildcard for about:home
// is similar, and also allows for falling back to loading the
// about:home document dynamically if an attempt is made to load
// about:home?jscache from the AboutHomeStartupCache as a top-level
// load.
matches: ["about:home*", "about:welcome", "about:newtab*"],
remoteTypes: ["privilegedabout"],
},
AboutPlugins: {
parent: {
esModuleURI: "resource:///actors/AboutPluginsParent.sys.mjs",
......@@ -307,27 +277,6 @@ let JSWINDOWACTORS = {
matches: ["about:plugins"],
},
AboutPocket: {
parent: {
esModuleURI: "resource:///actors/AboutPocketParent.sys.mjs",
},
child: {
esModuleURI: "resource:///actors/AboutPocketChild.sys.mjs",
events: {
DOMDocElementInserted: { capture: true },
},
},
remoteTypes: ["privilegedabout"],
matches: [
"about:pocket-saved*",
"about:pocket-signup*",
"about:pocket-home*",
"about:pocket-style-guide*",
],
},
AboutPrivateBrowsing: {
parent: {
esModuleURI: "resource:///actors/AboutPrivateBrowsingParent.sys.mjs",
......@@ -760,27 +709,6 @@ let JSWINDOWACTORS = {
matches: ["about:studies*"],
},
ASRouter: {
parent: {
esModuleURI: "resource:///actors/ASRouterParent.sys.mjs",
},
child: {
esModuleURI: "resource:///actors/ASRouterChild.sys.mjs",
events: {
// This is added so the actor instantiates immediately and makes
// methods available to the page js on load.
DOMDocElementInserted: {},
},
},
matches: [
"about:home*",
"about:newtab*",
"about:welcome*",
"about:privatebrowsing*",
],
remoteTypes: ["privilegedabout"],
},
SwitchDocumentDirection: {
child: {
esModuleURI: "resource:///actors/SwitchDocumentDirectionChild.sys.mjs",
......@@ -1291,6 +1219,20 @@ BrowserGlue.prototype = {
// handle any UI migration
this._migrateUI();
// Clear possibly auto enabled enterprise_roots prefs (see bug 40166)
if (
!Services.prefs.getBoolPref(
"security.certerrors.mitm.auto_enable_enterprise_roots"
) &&
Services.prefs.getBoolPref(
"security.enterprise_roots.auto-enabled",
false
)
) {
Services.prefs.clearUserPref("security.enterprise_roots.enabled");
Services.prefs.clearUserPref("security.enterprise_roots.auto-enabled");
}
if (!Services.prefs.prefHasUserValue(PREF_PDFJS_ISDEFAULT_CACHE_STATE)) {
lazy.PdfJs.checkIsDefault(this._isNewProfile);
}
......@@ -1305,8 +1247,6 @@ BrowserGlue.prototype = {
lazy.Normandy.init();
}
lazy.SaveToPocket.init();
AboutHomeStartupCache.init();
Services.obs.notifyObservers(null, "browser-ui-startup-complete");
......@@ -1629,8 +1569,6 @@ BrowserGlue.prototype = {
// the first browser window has finished initializing
_onFirstWindowLoaded: function BG__onFirstWindowLoaded(aWindow) {
lazy.AboutNewTab.init();
lazy.TabCrashHandler.init();
lazy.ProcessHangMonitor.init();
......@@ -1968,9 +1906,12 @@ BrowserGlue.prototype = {
() => lazy.PageDataService.uninit(),
() => lazy.PageThumbs.uninit(),
() => lazy.NewTabUtils.uninit(),
() => lazy.Normandy.uninit(),
() => {
if (AppConstants.MOZ_NORMANDY) {
lazy.Normandy.uninit();
}
},
() => lazy.RFPHelper.uninit(),
() => lazy.ASRouterNewTabHook.destroy(),
() => {
if (AppConstants.MOZ_UPDATER) {
lazy.UpdateListener.reset();
......@@ -2051,19 +1992,21 @@ BrowserGlue.prototype = {
// There is no pref for this add-on because it shouldn't be disabled.
const ID = "addons-search-detection@mozilla.com";
let addon = await lazy.AddonManager.getAddonByID(ID);
try {
let addon = await lazy.AddonManager.getAddonByID(ID);
// first time install of addon and install on firefox update
addon =
(await lazy.AddonManager.maybeInstallBuiltinAddon(
ID,
"2.0.0",
"resource://builtin-addons/search-detection/"
)) || addon;
// first time install of addon and install on firefox update
addon =
(await lazy.AddonManager.maybeInstallBuiltinAddon(
ID,
"2.0.0",
"resource://builtin-addons/search-detection/"
)) || addon;
if (!addon.isActive) {
addon.enable();
}
if (addon && !addon.isActive) {
addon.enable();
}
} catch (e) {}
},
_monitorHTTPSOnlyPref() {
......@@ -2296,8 +2239,6 @@ BrowserGlue.prototype = {
this._monitorScreenshotsPref();
this._monitorWebcompatReporterPref();
this._monitorHTTPSOnlyPref();
this._monitorIonPref();
this._monitorIonStudies();
this._setupSearchDetection();
this._monitorGPCPref();
......@@ -2768,13 +2709,6 @@ BrowserGlue.prototype = {
},
},
{
name: "ASRouterNewTabHook.createInstance",
task: () => {
lazy.ASRouterNewTabHook.createInstance(lazy.ASRouterDefaultConfig());
},
},
{
name: "BackgroundUpdate",
condition: AppConstants.MOZ_UPDATE_AGENT,
......@@ -6024,12 +5958,8 @@ export var AboutHomeStartupCache = {
return { pageInputStream: null, scriptInputStream: null };
}
let state = lazy.AboutNewTab.activityStream.store.getState();
return new Promise(resolve => {
this._cacheDeferred = resolve;
this.log.trace("Parent is requesting cache streams.");
this._procManager.sendAsyncMessage(this.CACHE_REQUEST_MESSAGE, { state });
});
this.log.error("Activity Stream is disabled.");
return { pageInputStream: null, scriptInputStream: null };
},
/**
......
......@@ -79,7 +79,7 @@ static const RedirEntry kRedirMap[] = {
nsIAboutModule::HIDE_FROM_ABOUTABOUT},
{"policies", "chrome://browser/content/policies/aboutPolicies.html",
nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI},
{"privatebrowsing", "chrome://browser/content/aboutPrivateBrowsing.html",
{"privatebrowsing", "about:blank",
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::URI_MUST_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT |
nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS},
......@@ -115,6 +115,7 @@ static const RedirEntry kRedirMap[] = {
nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT},
#ifndef BASE_BROWSER_VERSION
{"pocket-saved", "chrome://pocket/content/panels/saved.html",
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::URI_MUST_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT |
......@@ -135,6 +136,7 @@ static const RedirEntry kRedirMap[] = {
nsIAboutModule::URI_MUST_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT |
nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |
nsIAboutModule::HIDE_FROM_ABOUTABOUT},
#endif
{"preferences", "chrome://browser/content/preferences/preferences.xhtml",
nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI},
{"downloads",
......@@ -146,14 +148,6 @@ static const RedirEntry kRedirMap[] = {
nsIAboutModule::HIDE_FROM_ABOUTABOUT},
{"restartrequired", "chrome://browser/content/aboutRestartRequired.xhtml",
nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT},
{"protections", "chrome://browser/content/protections.html",
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::URI_MUST_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT |
nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |
nsIAboutModule::IS_SECURE_CHROME_UI},
{"ion", "chrome://browser/content/ion.html",
nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT |
nsIAboutModule::IS_SECURE_CHROME_UI},
};
static nsAutoCString GetAboutModuleName(nsIURI* aURI) {
......@@ -207,7 +201,8 @@ AboutRedirector::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo,
// enabled about:newtab. Disabled about:newtab page uses fallback.
if (path.EqualsLiteral("home") ||
(StaticPrefs::browser_newtabpage_enabled() &&
path.EqualsLiteral("newtab"))) {
path.EqualsLiteral("newtab")) ||
path.EqualsLiteral("privatebrowsing")) {
nsCOMPtr<nsIAboutNewTabService> aboutNewTabService =
do_GetService("@mozilla.org/browser/aboutnewtab-service;1", &rv);
NS_ENSURE_SUCCESS(rv, rv);
......
......@@ -16,15 +16,9 @@ pages = [
'firefoxview-next',
'messagepreview',
'newtab',
'ion',
'pocket-home',
'pocket-saved',
'pocket-signup',
'pocket-style-guide',
'policies',
'preferences',
'privatebrowsing',
'protections',
'profiling',
'reader',
'restartrequired',
......
......@@ -58,6 +58,7 @@ XPCOMUtils.defineLazyGetter(lazy, "AboutLoginsL10n", () => {
const ABOUT_LOGINS_ORIGIN = "about:logins";
const AUTH_TIMEOUT_MS = 5 * 60 * 1000; // 5 minutes
const PRIMARY_PASSWORD_NOTIFICATION_ID = "primary-password-login-required";
const NOCERTDB_PREF = "security.nocertdb";
// about:logins will always use the privileged content process,
// even if it is disabled for other consumers such as about:newtab.
......@@ -319,6 +320,7 @@ export class AboutLoginsParent extends JSWindowActorParent {
importVisible:
Services.policies.isAllowed("profileImport") &&
AppConstants.platform != "linux",
canCreateLogins: !Services.prefs.getBoolPref(NOCERTDB_PREF, false),
});
await AboutLogins.sendAllLoginRelatedObjects(
......
......@@ -62,6 +62,11 @@ login-item[data-editing="true"] + login-intro,
display: none;
}
/* Do not promote Mozilla Sync. */
login-intro {
display: none !important;
}
.heading-wrapper {
display: flex;
justify-content: center;
......
......@@ -24,6 +24,9 @@ const gElements = {
".menuitem-remove-all-logins"
);
},
get createNewLoginButton() {
return this.loginList.shadowRoot.querySelector(".create-login-button");
},
};
let numberOfLogins = 0;
......@@ -126,6 +129,9 @@ window.addEventListener("AboutLoginsChromeToContent", event => {
gElements.loginList.setSortDirection(event.detail.value.selectedSort);
document.documentElement.classList.add("initialized");
gElements.loginList.classList.add("initialized");
if (!event.detail.value.canCreateLogins) {
gElements.createNewLoginButton.disabled = true;
}
break;
}
case "ShowLoginItemError": {
......
......@@ -8,6 +8,11 @@
align-items: center;
}
/* Do not promote Mozilla Sync. */
.logged-out-view {
display: none !important;
}
.fxaccounts-extra-text {
/* Only show at most 3 lines of text to limit the
text from overflowing the header. */
......
......@@ -69,6 +69,11 @@ const kSubviewEvents = ["ViewShowing", "ViewHiding"];
*/
var kVersion = 19;
/**
* The current version for base browser.
*/
var kVersionBaseBrowser = 1;
/**
* Buttons removed from built-ins by version they were removed. kVersion must be
* bumped any time a new id is added to this. Use the button id as key, and
......@@ -224,6 +229,7 @@ var CustomizableUIInternal = {
this._updateForNewVersion();
this._updateForNewProtonVersion();
this._markObsoleteBuiltinButtonsSeen();
this._updateForBaseBrowser();
this.registerArea(
CustomizableUI.AREA_FIXED_OVERFLOW_PANEL,
......@@ -252,10 +258,15 @@ var CustomizableUIInternal = {
Services.policies.isAllowed("removeHomeButtonByDefault")
? null
: "home-button",
"spring",
// Don't want springs either side of the urlbar. tor-browser#41736
"urlbar-container",
"spring",
"save-to-pocket-button",
// save-to-pocket-button is entirely disabled. See tor-browser#18886 and
// tor-browser#31602.
// Base-browser additions tor-browser#41736. If you want to add to, remove
// from, or rearrange this list, then bump the kVersionBaseBrowser and
// update existing saved states in _updateForBaseBrowser.
"security-level-button",
"new-identity-button",
"downloads-button",
AppConstants.MOZ_DEV_EDITION ? "developer-button" : null,
"fxa-toolbar-menu-button",
......@@ -271,6 +282,10 @@ var CustomizableUIInternal = {
},
true
);
// navbarPlacements does not match the initial default XHTML layout.
// Therefore we always need to rebuild the navbar area when
// registerToolbarNode is called. tor-browser#41736
gDirtyAreaCache.add(CustomizableUI.AREA_NAVBAR);
if (AppConstants.MENUBAR_CAN_AUTOHIDE) {
this.registerArea(
......@@ -749,6 +764,104 @@ var CustomizableUIInternal = {
}
},
_updateForBaseBrowser() {
if (!gSavedState) {
// Use the defaults.
return;
}
const currentVersion = gSavedState.currentVersionBaseBrowser;
if (currentVersion < 1) {
// NOTE: In base-browser/tor-browser version 12.5a5, and earlier, the
// toolbar was configured by setting the full JSON string for the default
// "browser.uiCustomization.state" preference value. The disadvantage is
// that we could not update this value in a way that existing users (who
// would have non-default preference values) would also get the desired
// change (e.g. for adding or removing a button).
//
// With tor-browser#41736 we want to switch to changing the toolbar
// dynamically like firefox. Therefore, this first version transfer simply
// gets the toolbar into the same state we wanted before, away from the
// default firefox state.
//
// If an existing user state aligned with the previous default
// "browser.uiCustomization.state" then this shouldn't visibly change
// anything.
// If a user explicitly customized the toolbar to go back to the firefox
// default, then this may undo those changes.
const navbarPlacements =
gSavedState.placements[CustomizableUI.AREA_NAVBAR];
if (navbarPlacements) {
const getBeforeAfterUrlbar = () => {
// NOTE: The urlbar is non-removable from the navbar, so should have
// an index.
const index = navbarPlacements.indexOf("urlbar-container");
let after = index + 1;
if (
after < navbarPlacements.length &&
navbarPlacements[after] === "search-container"
) {
// Skip past the search-container.
after++;
}
return { before: index - 1, after };
};
// Remove the urlbar springs either side of the urlbar.
const { before, after } = getBeforeAfterUrlbar();
if (
after < navbarPlacements.length &&
this.matchingSpecials(navbarPlacements[after], "spring")
) {
// Remove the spring after.
navbarPlacements.splice(after, 1);
// NOTE: The `before` index does not change.
}
if (
before >= 0 &&
this.matchingSpecials(navbarPlacements[before], "spring")
) {
// Remove the spring before.
navbarPlacements.splice(before, 1);
}
// Make sure the security-level-button and new-identity-button appears
// in the toolbar.
for (const id of ["new-identity-button", "security-level-button"]) {
let alreadyAdded = false;
for (const placements of Object.values(gSavedState.placements)) {
if (placements.includes(id)) {
alreadyAdded = true;
break;
}
}
if (alreadyAdded) {
continue;
}
// Add to the nav-bar, after the urlbar-container.
// NOTE: We have already removed the spring after the urlbar.
navbarPlacements.splice(getBeforeAfterUrlbar().after, 0, id);
}
}
// Remove save-to-pocket-button. See tor-browser#18886 and
// tor-browser#31602.
for (const placements of Object.values(gSavedState.placements)) {
let buttonIndex = placements.indexOf("save-to-pocket-button");
if (buttonIndex != -1) {
placements.splice(buttonIndex, 1);
}
}
// Remove unused fields that used to be part of
// "browser.uiCustomization.state".
delete gSavedState.placements["PanelUI-contents"];
delete gSavedState.placements["addon-bar"];
}
},
_placeNewDefaultWidgetsInArea(aArea) {
let futurePlacedWidgets = gFuturePlacements.get(aArea);
let savedPlacements =
......@@ -2589,6 +2702,10 @@ var CustomizableUIInternal = {
gSavedState.currentVersion = 0;
}
if (!("currentVersionBaseBrowser" in gSavedState)) {
gSavedState.currentVersionBaseBrowser = 0;
}
gSeenWidgets = new Set(gSavedState.seen || []);
gDirtyAreaCache = new Set(gSavedState.dirtyAreaCache || []);
gNewElementCount = gSavedState.newElementCount || 0;
......@@ -2671,6 +2788,7 @@ var CustomizableUIInternal = {
seen: gSeenWidgets,
dirtyAreaCache: gDirtyAreaCache,
currentVersion: kVersion,
currentVersionBaseBrowser: kVersionBaseBrowser,
newElementCount: gNewElementCount,
};
......
......@@ -196,7 +196,7 @@
hasicon="true"
hidden="true">
<popupnotificationcontent id="update-restart-notification-content" orient="vertical">
<description id="update-restart-description" data-lazy-l10n-id="appmenu-update-restart-message2"></description>
<description id="update-restart-description">&#160;</description>
</popupnotificationcontent>
</popupnotification>
......
......@@ -192,6 +192,10 @@ this.browserAction = class extends ExtensionAPIPersistent {
}
build() {
// The extension ID for NoScript (WebExtension)
const isNoScript =
this.extension.id === "{73a6fe31-595d-460b-a920-fcc0f8843232}";
let { extension } = this;
let widgetId = makeWidgetId(extension.id);
let widget = CustomizableUI.createWidget({
......@@ -202,7 +206,11 @@ this.browserAction = class extends ExtensionAPIPersistent {
removable: true,
label: this.action.getProperty(null, "title"),
tooltiptext: this.action.getProperty(null, "title"),
defaultArea: browserAreas[this.action.getDefaultArea()],
// Do not want to add the NoScript extension to the toolbar by default.
// tor-browser#41736
defaultArea: isNoScript
? null
: browserAreas[this.action.getDefaultArea()],
showInPrivateBrowsing: extension.privateBrowsingAllowed,
disallowSubView: true,
......
......@@ -37,22 +37,21 @@ DIRS += [
"enterprisepolicies",
"extensions",
"firefoxview",
"ion",
"messagepreview",
"migration",
"newidentity",
"newtab",
"originattributes",
"pagedata",
"places",
"pocket",
"preferences",
"privatebrowsing",
"prompts",
"protections",
"protocolhandler",
"resistfingerprinting",
"screenshots",
"search",
"securitylevel",
"sessionstore",
"shell",
"syncedtabs",
......
/* 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/. */
#infoTitle {
font-weight: 600;
}