-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.js
38 lines (35 loc) · 975 Bytes
/
main.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
// Translate the keyboard shortcuts in manifest.json
chrome.commands.onCommand.addListener(function(command) {
var config = {};
switch(command) {
case "link":
config.template = "l";
break;
case "capture":
config.template = "c";
break;
case "other":
config.template = "o";
break;
case "query":
config.template = "q";
break;
}
chrome.tabs.executeScript(
{code: 'var config = ' + JSON.stringify(config)},
function () {
chrome.tabs.executeScript(
{file: 'capturing.js'},
(function (url_array) {}
))
}
);
});
// Not useful if we are using a popup
// chrome.browserAction.onClicked.addListener(function(tab) {
// chrome.tabs.executeScript(
// {file: "capturing.js"},
// (function (url_array) {
// chrome.tabs.update({url : url_array[0]});
// }));
// });