mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-29 18:47:31 +09:00
Add e10s in preferences (enabled by default)
This commit is contained in:
parent
27fba4cabb
commit
c9ae15ae7b
3 changed files with 64 additions and 0 deletions
|
|
@ -11,6 +11,8 @@ const PREF_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
|
||||||
|
|
||||||
var gAdvancedPane = {
|
var gAdvancedPane = {
|
||||||
_inited: false,
|
_inited: false,
|
||||||
|
_shouldPromptForE10sRestart: true,
|
||||||
|
_storedE10sEnabled: false,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Brings the appropriate tab to the front and initializes various bits of UI.
|
* Brings the appropriate tab to the front and initializes various bits of UI.
|
||||||
|
|
@ -77,6 +79,10 @@ var gAdvancedPane = {
|
||||||
gAdvancedPane.showSecurityDevices);
|
gAdvancedPane.showSecurityDevices);
|
||||||
setEventListener("cacheSize", "change",
|
setEventListener("cacheSize", "change",
|
||||||
gAdvancedPane.updateCacheSizePref);
|
gAdvancedPane.updateCacheSizePref);
|
||||||
|
setEventListener("e10sEnabled", "command",
|
||||||
|
gAdvancedPane.updateE10sCheckbox);
|
||||||
|
|
||||||
|
this._storedE10sEnabled = document.getElementById("e10sEnabled").checked;
|
||||||
|
|
||||||
if (AppConstants.MOZ_WIDGET_GTK) {
|
if (AppConstants.MOZ_WIDGET_GTK) {
|
||||||
// GTK tabbox' allow the scroll wheel to change the selected tab,
|
// GTK tabbox' allow the scroll wheel to change the selected tab,
|
||||||
|
|
@ -170,6 +176,50 @@ var gAdvancedPane = {
|
||||||
return 0;
|
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.
|
* 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.
|
* A value of 1 means OCSP is enabled. Any other value means it is disabled.
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,12 @@
|
||||||
<preference id="layout.spellcheckDefault"
|
<preference id="layout.spellcheckDefault"
|
||||||
name="layout.spellcheckDefault"
|
name="layout.spellcheckDefault"
|
||||||
type="int"/>
|
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 -->
|
<!-- Network tab -->
|
||||||
<preference id="browser.cache.disk.capacity"
|
<preference id="browser.cache.disk.capacity"
|
||||||
|
|
@ -177,6 +183,12 @@
|
||||||
onsyncfrompreference="return gAdvancedPane.readCheckSpelling();"
|
onsyncfrompreference="return gAdvancedPane.readCheckSpelling();"
|
||||||
onsynctopreference="return gAdvancedPane.writeCheckSpelling();"
|
onsynctopreference="return gAdvancedPane.writeCheckSpelling();"
|
||||||
preference="layout.spellcheckDefault"/>
|
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>
|
</groupbox>
|
||||||
</tabpanel>
|
</tabpanel>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,8 @@
|
||||||
<!ENTITY allowHWAccel.accesskey "r">
|
<!ENTITY allowHWAccel.accesskey "r">
|
||||||
<!ENTITY checkSpelling.label "Check my spelling as I type">
|
<!ENTITY checkSpelling.label "Check my spelling as I type">
|
||||||
<!ENTITY checkSpelling.accesskey "t">
|
<!ENTITY checkSpelling.accesskey "t">
|
||||||
|
<!ENTITY e10sEnabled.label "Enable multi-process &brandShortName; (requires restart)">
|
||||||
|
<!ENTITY e10sEnabled.accesskey "E">
|
||||||
|
|
||||||
<!ENTITY dataChoicesTab.label "Data Choices">
|
<!ENTITY dataChoicesTab.label "Data Choices">
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue