-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackground.js
More file actions
27 lines (24 loc) · 790 Bytes
/
background.js
File metadata and controls
27 lines (24 loc) · 790 Bytes
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
chrome.omnibox.onInputEntered.addListener(function(text) {
lookUpBookmark(text);
});
chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
switch(message.type) {
case "saveBookmark":
saveBookmark(message.text, message.url);
break;
case "deleteBookmark":
deleteBookmark(message.text);
break;
}
});
chrome.storage.onChanged.addListener(function(changes, namespace) {
for (key in changes) {
var storageChange = changes[key];
console.log('Storage key "%s" in namespace "%s" changed. ' +
'Old value was "%s", new value is "%s".',
key,
namespace,
storageChange.oldValue,
storageChange.newValue);
}
});