-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathextension.js
93 lines (83 loc) · 2.47 KB
/
extension.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
window.browser = (function () {
return window.msBrowser ||
window.browser ||
window.chrome;
})();
// Create context menu
browser.contextMenus.create({
id: 'dutch-waze-kit',
title: "Dutch Waze Kit",
contexts: ["page"]
});
browser.contextMenus.create({
id: 'dwk-open-in-bag',
title: "Openen in BAG",
parentId: 'dutch-waze-kit'
});
browser.contextMenus.create({
id: 'dwk-open-in-melvin',
title: "Openen in Melvin",
parentId: 'dutch-waze-kit'
});
browser.contextMenus.create({
id: 'dwk-open-in-ruimtelijke-plannen',
title: "Openen in Ruimtelijke Plannen",
parentId: 'dutch-waze-kit'
});
browser.contextMenus.create({
id: 'dwk-open-in-satelliet-data-portaal',
title: "Openen in Satelliet Data Portaal",
parentId: 'dutch-waze-kit'
});
browser.contextMenus.create({
id: 'dwk-open-in-google-maps',
title: "Openen in Google Maps",
parentId: 'dutch-waze-kit'
});
browser.contextMenus.create({
id: 'dwk-open-in-mapillary',
title: "Openen in Mapillary",
parentId: 'dutch-waze-kit'
});
browser.contextMenus.create({
id: 'dwk-open-in-wegstatus',
title: "Openen in Wegstatus",
parentId: 'dutch-waze-kit'
});
// browser.contextMenus.create({
// type: 'separator',
// parentId: 'dutch-waze-kit'
// });
// Called when the user clicks on a context menu item
browser.contextMenus.onClicked.addListener(function(info, tab) {
switch(info.menuItemId) {
case 'dwk-open-in-bag': {
browser.tabs.sendMessage(tab.id, { text: 'open-in-bag' });
break;
}
case 'dwk-open-in-melvin': {
browser.tabs.sendMessage(tab.id, { text: 'open-in-melvin' });
break;
}
case 'dwk-open-in-ruimtelijke-plannen': {
browser.tabs.sendMessage(tab.id, { text: 'open-in-ruimtelijke-plannen' });
break;
}
case 'dwk-open-in-satelliet-data-portaal': {
browser.tabs.sendMessage(tab.id, { text: 'open-in-satelliet-data-portaal' });
break;
}
case 'dwk-open-in-google-maps': {
browser.tabs.sendMessage(tab.id, { text: 'open-in-google-maps' });
break;
}
case 'dwk-open-in-mapillary': {
browser.tabs.sendMessage(tab.id, { text: 'open-in-mapillary' });
break;
}
case 'dwk-open-in-wegstatus': {
browser.tabs.sendMessage(tab.id, { text: 'open-in-wegstatus' });
break;
}
}
});