The code you're looking for, the map of loaded extensions, is also a part of the ExtensionSystem
module, whereas the ExtensionUtils
module is mostly utilities for extension authors like GSettings and Gettext helpers.
The functions you are looking for are a part of the class ExtensionManager
in 3.34+. You can get the ExtensionManager
instance from the Main
import:
// >= 3.34
const Main = imports.ui.main;
const ExtensionManager = Main.extensionManager;
ExtensionManager.disableExtension(uuid);
// <= 3.32
const ExtensionSystem = imports.misc.extensionSystem;
ExtensionSystem.disableExtension(uuid);
// Handling both versions
const Config = imports.misc.config;
if (Config.PACKAGE_VERSION.split('.')[1] >= 34) {
let manager = imports.ui.main.extensionManager;
manager.disableExtension(uuid);
} else {
let extSystem = imports.misc.extensionSystem;
extSystem.disableExtension(uuid);
}
Sources:
You can use the branch selector on the left of the GitLab page to select the version, or the history button on the right to view a list of changes to a given file.