diff --git a/data/org.gnome.shell.gschema.xml.in b/data/org.gnome.shell.gschema.xml.in
index c1e6b21da..7348d0908 100644
--- a/data/org.gnome.shell.gschema.xml.in
+++ b/data/org.gnome.shell.gschema.xml.in
@@ -21,6 +21,14 @@
EnableExtension and DisableExtension D-Bus methods on org.gnome.Shell.
+
+ false
+ Disable user extensions
+
+ Disable all extensions the user has enabled without affecting
+ the 'enabled-extension' setting.
+
+
true
Disables the validation of extension version compatibility
diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js
index ba332220b..a4dc29eea 100644
--- a/js/ui/extensionSystem.js
+++ b/js/ui/extensionSystem.js
@@ -38,6 +38,7 @@ const connect = Lang.bind(_signals, _signals.connect);
const disconnect = Lang.bind(_signals, _signals.disconnect);
const ENABLED_EXTENSIONS_KEY = 'enabled-extensions';
+const DISABLE_USER_EXTENSIONS_KEY = 'disable-user-extensions';
const EXTENSION_DISABLE_VERSION_CHECK_KEY = 'disable-extension-version-validation';
var initted = false;
@@ -238,11 +239,16 @@ function initExtension(uuid) {
}
function getEnabledExtensions() {
- let extensions = global.settings.get_strv(ENABLED_EXTENSIONS_KEY);
- if (!Array.isArray(Main.sessionMode.enabledExtensions))
+ let extensions;
+ if (Array.isArray(Main.sessionMode.enabledExtensions))
+ extensions = Main.sessionMode.enabledExtensions;
+ else
+ extensions = [];
+
+ if (global.settings.get_boolean(DISABLE_USER_EXTENSIONS_KEY))
return extensions;
- return Main.sessionMode.enabledExtensions.concat(extensions);
+ return extensions.concat(global.settings.get_strv(ENABLED_EXTENSIONS_KEY));
}
function onEnabledExtensionsChanged() {
@@ -288,6 +294,7 @@ function _onVersionValidationChanged() {
function _loadExtensions() {
global.settings.connect('changed::' + ENABLED_EXTENSIONS_KEY, onEnabledExtensionsChanged);
+ global.settings.connect('changed::' + DISABLE_USER_EXTENSIONS_KEY, onEnabledExtensionsChanged);
global.settings.connect('changed::' + EXTENSION_DISABLE_VERSION_CHECK_KEY, _onVersionValidationChanged);
enabledExtensions = getEnabledExtensions();