extensionUtils: Add utility for setting the current extension
ES modules do not allow exports to be overriden, in anticipation of the ESM port add a `setCurrentExtension` utility which will throw if used in the shell. This is tested using a conditional import of Main. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2363>
This commit is contained in:
@ -18,7 +18,7 @@ var ExtensionPrefsDialog = GObject.registerClass({
|
||||
ExtensionUtils.installImporter(extension);
|
||||
|
||||
// give extension prefs access to their own extension object
|
||||
ExtensionUtils.getCurrentExtension = () => extension;
|
||||
ExtensionUtils.setCurrentExtension(extension);
|
||||
|
||||
const prefsModule = extension.imports.prefs;
|
||||
prefsModule.init(extension.metadata);
|
||||
|
Reference in New Issue
Block a user