diff --git a/js/extensions/extension.js b/js/extensions/extension.js index 125b7a350..b9e72584a 100644 --- a/js/extensions/extension.js +++ b/js/extensions/extension.js @@ -8,6 +8,8 @@ export { pgettext } from './sharedInternals.js'; +const {extensionManager} = imports.ui.main; + /** * Open the preference dialog of the current extension */ @@ -17,12 +19,5 @@ export function openPrefs() { if (!extension) throw new Error('openPrefs() can only be called from extensions'); - try { - const extensionManager = imports.ui.main.extensionManager; - extensionManager.openExtensionPrefs(extension.uuid, '', {}); - } catch (e) { - if (e.name === 'ImportError') - throw new Error('openPrefs() cannot be called from preferences'); - logError(e, 'Failed to open extension preferences'); - } + extensionManager.openExtensionPrefs(extension.uuid, '', {}); }