diff --git a/js/misc/introspect.js b/js/misc/introspect.js index f256555cb..f99ea84e9 100644 --- a/js/misc/introspect.js +++ b/js/misc/introspect.js @@ -40,6 +40,15 @@ var IntrospectService = class { }); this._syncRunningApplications(); + + this._whitelistMap = new Map(); + APP_WHITELIST.forEach(appName => { + Gio.DBus.watch_name(Gio.BusType.SESSION, + appName, + Gio.BusNameWatcherFlags.NONE, + (conn, name, owner) => this._whitelistMap.set(name, owner), + (conn, name) => this._whitelistMap.delete(name)); + }); } _isStandaloneApp(app) { @@ -51,7 +60,7 @@ var IntrospectService = class { } _isSenderWhitelisted(sender) { - return APP_WHITELIST.includes(sender); + return [...this._whitelistMap.values()].includes(sender); } _getSandboxedAppId(app) {