Add e10s in preferences (enabled by default)

This commit is contained in:
ownedbywuigi 2026-03-29 22:19:00 +01:00
commit c9ae15ae7b
3 changed files with 64 additions and 0 deletions

View file

@ -11,6 +11,8 @@ const PREF_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
var gAdvancedPane = {
_inited: false,
_shouldPromptForE10sRestart: true,
_storedE10sEnabled: false,
/**
* Brings the appropriate tab to the front and initializes various bits of UI.
@ -77,6 +79,10 @@ var gAdvancedPane = {
gAdvancedPane.showSecurityDevices);
setEventListener("cacheSize", "change",
gAdvancedPane.updateCacheSizePref);
setEventListener("e10sEnabled", "command",
gAdvancedPane.updateE10sCheckbox);
this._storedE10sEnabled = document.getElementById("e10sEnabled").checked;
if (AppConstants.MOZ_WIDGET_GTK) {
// GTK tabbox' allow the scroll wheel to change the selected tab,
@ -170,6 +176,50 @@ var gAdvancedPane = {
return 0;
},
readE10sEnabled: function ()
{
let autostart = document.getElementById("browser.tabs.remote.autostart").value;
let trialAutostart = document.getElementById("browser.tabs.remote.autostart.2").value;
return !!(autostart || trialAutostart);
},
writeE10sEnabled: function ()
{
let enabled = document.getElementById("e10sEnabled").checked;
document.getElementById("browser.tabs.remote.autostart.2").value = enabled;
return enabled;
},
updateE10sCheckbox: function ()
{
let checkbox = document.getElementById("e10sEnabled");
let enabled = checkbox.checked;
if (enabled == this._storedE10sEnabled) {
return;
}
if (!this._shouldPromptForE10sRestart) {
return;
}
let buttonIndex = confirmRestartPrompt(enabled, 1, true, false);
if (buttonIndex == CONFIRM_RESTART_PROMPT_RESTART_NOW) {
document.getElementById("browser.tabs.remote.autostart").value = enabled;
document.getElementById("browser.tabs.remote.autostart.2").value = enabled;
let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"]
.getService(Ci.nsIAppStartup);
appStartup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
return;
}
this._shouldPromptForE10sRestart = false;
checkbox.checked = this._storedE10sEnabled;
document.getElementById("browser.tabs.remote.autostart").value = this._storedE10sEnabled;
document.getElementById("browser.tabs.remote.autostart.2").value = this._storedE10sEnabled;
this._shouldPromptForE10sRestart = true;
},
/**
* security.OCSP.enabled is an integer value for legacy reasons.
* A value of 1 means OCSP is enabled. Any other value means it is disabled.

View file

@ -46,6 +46,12 @@
<preference id="layout.spellcheckDefault"
name="layout.spellcheckDefault"
type="int"/>
<preference id="browser.tabs.remote.autostart"
name="browser.tabs.remote.autostart"
type="bool"/>
<preference id="browser.tabs.remote.autostart.2"
name="browser.tabs.remote.autostart.2"
type="bool"/>
<!-- Network tab -->
<preference id="browser.cache.disk.capacity"
@ -177,6 +183,12 @@
onsyncfrompreference="return gAdvancedPane.readCheckSpelling();"
onsynctopreference="return gAdvancedPane.writeCheckSpelling();"
preference="layout.spellcheckDefault"/>
<checkbox id="e10sEnabled"
label="&e10sEnabled.label;"
accesskey="&e10sEnabled.accesskey;"
onsyncfrompreference="return gAdvancedPane.readE10sEnabled();"
onsynctopreference="return gAdvancedPane.writeE10sEnabled();"
preference="browser.tabs.remote.autostart"/>
</groupbox>
</tabpanel>

View file

@ -27,6 +27,8 @@
<!ENTITY allowHWAccel.accesskey "r">
<!ENTITY checkSpelling.label "Check my spelling as I type">
<!ENTITY checkSpelling.accesskey "t">
<!ENTITY e10sEnabled.label "Enable multi-process &brandShortName; (requires restart)">
<!ENTITY e10sEnabled.accesskey "E">
<!ENTITY dataChoicesTab.label "Data Choices">