| 1 |
// SPDX-FileCopyrightText: 2013 Gabriel Rossetti <[email protected]> |
| 2 |
// SPDX-FileCopyrightText: 2013 Florian Müllner <[email protected]> |
| 3 |
// |
| 4 |
// SPDX-License-Identifier: GPL-2.0-or-later |
| 5 |
|
| 6 |
import {AppIcon} from 'resource:///org/gnome/shell/ui/appDisplay.js'; |
| 7 |
import {InjectionManager} from 'resource:///org/gnome/shell/extensions/extension.js'; |
| 8 |
|
| 9 |
export default class Extension { |
| 10 |
enable() { |
| 11 |
this._injectionManager = new InjectionManager(); |
| 12 |
this._injectionManager.overrideMethod(AppIcon.prototype, 'activate', |
| 13 |
originalMethod => { |
| 14 |
return function () { |
| 15 |
// eslint-disable-next-line no-invalid-this |
| 16 |
originalMethod.call(this, 2); |
| 17 |
}; |
| 18 |
}); |
| 19 |
} |
| 20 |
|
| 21 |
disable() { |
| 22 |
this._injectionManager.clear(); |
| 23 |
this._injectionManager = null; |
| 24 |
} |
| 25 |
} |