Files
firefox/devtools/client/aboutdebugging/components/workers/multi-e10s-warning.js
T
Julian Descottes b1edf0370f Bug 1345932 - show warning info in about:debugging#workers if multi-e10s is on;r=ochameau
If multi e10s is enabled, service worker debugging is unavailable.
We temporarily disabled the start/push/debug buttons in about:debugging
for all service workers if multi-e10s is on.

A warning section is also displayed on top of about:debugging, letting the
user know that they can set dom.ipc.processCount to 1 in order to force
a single content process and restore debugging capabilities.

MozReview-Commit-ID: IPAlbOq2Hij
2017-03-16 16:06:05 +01:00

61 lines
1.8 KiB
JavaScript

/* 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/. */
/* eslint-env browser */
"use strict";
loader.lazyImporter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
const { createClass, DOM: dom } =
require("devtools/client/shared/vendor/react");
const Services = require("Services");
const { Ci } = require("chrome");
loader.lazyImporter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
loader.lazyRequireGetter(this, "DebuggerClient",
"devtools/shared/client/main", true);
const Strings = Services.strings.createBundle("chrome://devtools/locale/aboutdebugging.properties");
const PROCESS_COUNT_PREF = "dom.ipc.processCount";
module.exports = createClass({
displayName: "multiE10SWarning",
onUpdatePreferenceClick() {
let message = Strings.GetStringFromName("multiProcessWarningConfirmUpdate");
if (window.confirm(message)) {
Services.prefs.setIntPref(PROCESS_COUNT_PREF, 1);
// Restart the browser.
Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
}
},
render() {
return dom.div(
{
className: "service-worker-multi-process"
},
dom.div(
{},
dom.div({ className: "warning" }),
dom.b({}, Strings.GetStringFromName("multiProcessWarningTitle"))
),
dom.div(
{},
Strings.GetStringFromName("multiProcessWarningMessage")
),
dom.button(
{
className: "update-button",
onClick: this.onUpdatePreferenceClick,
},
Strings.GetStringFromName("multiProcessWarningUpdateLink")
)
);
},
});