0544729bba
The extension uses a straight-forward override that doesn't benefit a lot from the new InjectionManager class, but let's use the provided convenience API anyway. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/268>
24 lines
627 B
JavaScript
24 lines
627 B
JavaScript
import {InjectionManager} from 'resource:///org/gnome/shell/extensions/extension.js';
|
|
|
|
const {AppIcon} = imports.ui.appDisplay;
|
|
|
|
export default class Extension {
|
|
constructor() {
|
|
this._injectionManager = new InjectionManager();
|
|
}
|
|
|
|
enable() {
|
|
this._injectionManager.overrideMethod(AppIcon.prototype, 'activate',
|
|
originalMethod => {
|
|
return function () {
|
|
// eslint-disable-next-line no-invalid-this
|
|
originalMethod.call(this, 2);
|
|
};
|
|
});
|
|
}
|
|
|
|
disable() {
|
|
this._injectionManager.clear();
|
|
}
|
|
}
|