Bug 1660558 - Handle any exception thrown when trying to load Subprocess due to unsupported platforms. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D87954
This commit is contained in:
Jared Wein 2020-08-24 11:09:56 +00:00
Родитель 32685b1f6e
Коммит 2421d68d38
1 изменённых файлов: 10 добавлений и 4 удалений

Просмотреть файл

@ -22,10 +22,6 @@ const { FeatureGate } = ChromeUtils.import(
"resource://featuregates/FeatureGate.jsm"
);
let { Subprocess } = ChromeUtils.import(
"resource://gre/modules/Subprocess.jsm"
);
XPCOMUtils.defineLazyGlobalGetters(this, ["DOMParser"]);
// We use a preferences whitelist to make sure we only show preferences that
@ -441,6 +437,16 @@ var dataProviders = {
},
async environmentVariables(done) {
let Subprocess;
try {
// Subprocess is not available in all builds
Subprocess = ChromeUtils.import("resource://gre/modules/Subprocess.jsm")
.Subprocess;
} catch (ex) {
done({});
return;
}
let environment = Subprocess.getEnvironment();
let filteredEnvironment = {};
// Limit the environment variables to those that we