-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlib.js
43 lines (38 loc) · 967 Bytes
/
lib.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// ES6 import modules doesn't seems working in WebExtension context :/
/*
export var script_to_call = {file:'anchors-reveal.js'};
export var menu_id = 'anchors-reveal';
export var THEMES = {
'ClassicalYellow' : {
background : 'yellow',
color : 'black'
},
'LightBlue' : {
background : '#aaf',
color : 'black'
},
'WhitePaper' : {
background : 'white',
color : 'black'
},
'GothicAddict' : {
background : 'black',
color : 'white'
},
};
export function add_contextual_menu() {
browser.contextMenus.create({
id: menu_id,
title: browser.i18n.getMessage('buttonDescription'),
icons: {
'16': "data/icon-16.png",
'32': "data/icon-32.png"
}
});
browser.contextMenus.onClicked.addListener(function(info, tab) {
if (info.menuItemId === menu_id) {
browser.tabs.executeScript(script_to_call);
}
});
};
*/