diff --git a/js/misc/extensionUtils.js b/js/misc/extensionUtils.js index 2b7720abc..dc227801f 100644 --- a/js/misc/extensionUtils.js +++ b/js/misc/extensionUtils.js @@ -30,6 +30,7 @@ export const ExtensionState = { const SERIALIZED_PROPERTIES = [ 'type', 'state', + 'enabled', 'path', 'error', 'hasPrefs', diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index 55b1e1133..10e1d92de 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -429,6 +429,7 @@ export class ExtensionManager extends Signals.EventEmitter { path: dir.get_path(), error: '', hasPrefs: dir.get_child('prefs.js').query_exists(null), + enabled: this._enabledExtensions.includes(uuid), hasUpdate: false, canChange: false, sessionModes: meta['session-modes'] ? meta['session-modes'] : ['user'], @@ -609,6 +610,13 @@ export class ExtensionManager extends Signals.EventEmitter { async _onEnabledExtensionsChanged() { let newEnabledExtensions = this._getEnabledExtensions(); + for (const extension of this._extensions.values()) { + const wasEnabled = extension.enabled; + extension.enabled = newEnabledExtensions.includes(extension.uuid); + if (wasEnabled !== extension.enabled) + this.emit('extension-state-changed', extension); + } + // Find and enable all the newly enabled extensions: UUIDs found in the // new setting, but not in the old one. const extensionsToEnable = newEnabledExtensions