Bug 1716884 - Allow experimenting with disabling Keep in Dock / Pin to taskbar r=andreio

Add new NimbusFeature.shellService that is available at startup, e.g., for default browser prompt.

Differential Revision: https://phabricator.services.mozilla.com/D118092
This commit is contained in:
Ed Lee
2021-06-17 23:44:38 +00:00
parent c5e0b83a15
commit 0920a773c8
4 changed files with 69 additions and 7 deletions

View File

@@ -13,15 +13,11 @@ const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
ChromeUtils.defineModuleGetter(
this,
"WindowsRegistry",
"resource://gre/modules/WindowsRegistry.jsm"
);
XPCOMUtils.defineLazyModuleGetters(this, {
Subprocess: "resource://gre/modules/Subprocess.jsm",
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
setTimeout: "resource://gre/modules/Timer.jsm",
Subprocess: "resource://gre/modules/Subprocess.jsm",
WindowsRegistry: "resource://gre/modules/WindowsRegistry.jsm",
});
XPCOMUtils.defineLazyServiceGetter(
@@ -277,6 +273,11 @@ let ShellServiceInternal = {
);
}
// Pretend pinning is not needed/supported if remotely disabled.
if (NimbusFeatures.shellService.getVariable("disablePin")) {
return false;
}
// Currently this only works on certain Windows versions.
try {
// First check if we can even pin the app where an exception means no.