-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.js
More file actions
21 lines (17 loc) · 792 Bytes
/
api.js
File metadata and controls
21 lines (17 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import * as BackgroundMenu from 'resource:///org/gnome/shell/ui/backgroundMenu.js';
import * as Search from 'resource:///org/gnome/shell/ui/search.js';
export class API {
#originals = {};
open() {
// Override prototype — saves original first
this.#originals['bgOpen'] = BackgroundMenu.BackgroundMenu.prototype.open;
BackgroundMenu.BackgroundMenu.prototype.open = () => {};
this.#originals['startSearch'] = Search.SearchController.prototype.startSearch;
Search.SearchController.prototype.startSearch = () => {};
}
close() {
// Restore originals
BackgroundMenu.BackgroundMenu.prototype.open = this.#originals['bgOpen'];
Search.SearchController.prototype.startSearch = this.#originals['startSearch'];
}
}