-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackground.js
131 lines (104 loc) · 22 KB
/
background.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
var Bookmark = {
current_url: '',
Update: function(request) {
console.log('-> Bookmark.Update');
// Bookmark type
Bookmark.icon.type = request.bookmark_icon;
window.localStorage.setItem('toolbar_bookmark_icon', request.bookmark_icon);
if (request.bookmark_url !== Bookmark.current_url) {
window.localStorage.removeItem('toolbar_bookmark_url');
window.localStorage.setItem('toolbar_bookmark_url', request.bookmark_url);
Bookmark.current_url = request.bookmark_url;
Bookmark.icon.reset();
} else {
Bookmark.icon.load();
}
},
icon: {
type: window.localStorage.getItem('toolbar_bookmark_icon'),
// this is default icon returned by google s2.
//def: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACsElEQVQ4jaWTzU8TARDFf7bdfuy228K2RQrdWiCIUTSSEirqwWiIXrh58WCICSc88YdwwoPhrge9qImJeFBi+FAoB4kKEfloEcJaSrttWdptwQs0GL35TjPJvDdvZjLwnzh1HFy5O+IScg7/1d5Id7lyMLSbM2K6vu8G8HichXqva84qWB7NTK3Pmt5SevrZsFETuHJ3xOUypdD59sBgoVDub4sqQbVVUcpmFbtgJaoqjI8v7qylMppXcrz8svxrzBCKm9PPhg0bgJBz+M9fDAwW9yr3LlwKhaMRBUm009XZTHGvTCQk06L6lYXFTeXJ0zn3ubYAC58rj4CUBSDeG+nOFUv9DwZ6wtGIAkDZrDIzv16bNaiICIKVgfs9Yb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MZ9yltBIIiNSHWbOhkENRE6hLzeV8jwFDAe/bs0QpT5h9NKsa9SgUFJ1265hHy6AxgtXprwB5Dr1AGU9uzOizBWaAlpWWbRutsqgiuxjVeOCr5+eefN07b4DhpMu5rZM+bZvIwMcbpDGBGqgr/SBvwNQCRjswDdJ05c0b3eare0969j5oY6gFmko7hm2ny+c4772xWr15tiD0dn8gMaNauXfuJkZs2+yHHu9oWkZIQJwx2W48S+1FgrBALcbHzkGmAGgOsCIO/Cy64YCIfNd+SfmPGwYaVzoz82gGGgrYJN+R7SQAy0YJdF1346wxgIM7EQA3fUElchOwTZrhhiKItS5SFi/YC353aYBgBrvk6cuQIO/kbN25kT5M7QfQcqTlvH7lXM/OpXdxhax0LIxkO7SSbHRYqLxxwKvIo7e57sH2nTaTvxnalCZvDlUcHQnQS4LJTkjNByOYuLJPdVPDBF06DqGnSW2Y0dAJcTsPlmRwDTpHNsxLOBJAVHAVyrfDGCnb80ekmbk2iwlDnADt8+DD8oRSy6vhJGqw5dOhQkOA5OCSwLZ44cWI4ZQDQYZZBXOpvvFc9XDCbQv5oIkqzbt26Bl4vuNPQyQaykZfHH0MfdCo653v4TJnGiYi3Im0S0J1TTjXm1bkGkysGPEfhT0a2WbYmQM7f9Cz82aBtUcOp2ehMc5noLO1bUQCThQO7g9YjrqQmYGh3UFMqf072TN3vYdoAEhwj4SRJzz2YAiX+PwszkAxlwMUiAAAAAElFTkSuQmCC",
// it will try to load Icon from cache and if failed - will get icon from web
load: function() {
console.log('-> Bookmark.icon.load');
var cached_icon = Bookmark.icon.cache;
if (cached_icon) {
if (cached_icon === Bookmark.icon.def || Bookmark.icon.type === 'default') {
// load our own default Girl Icon
chrome.browserAction.setIcon({path: 'icon_18.png'});
} else {
chrome.browserAction.setIcon({path: cached_icon});
}
} else {
Bookmark.icon.reset();
}
},
get cache() {
var res = window.localStorage.getItem('icon_cache');
return (res)
? JSON.parse(res)
: false;
},
set cache(data) {
if (data) {
window.localStorage.setItem('icon_cache', JSON.stringify(data));
}
},
reset: function(url) {
console.log('-> Bookmark.icon.reset');
if (!url) {
url = window.localStorage.getItem('toolbar_bookmark_url');
}
var can = document.getElementById('canvas');
var ctx = can.getContext('2d');
var img = new Image();
img.onload = function(e){
can.width = img.width;
can.height = img.height;
ctx.drawImage(img, 0, 0, img.width, img.height);
Bookmark.icon.cache = can.toDataURL("image/png");
Bookmark.icon.load();
};
if (!url) {
url = '';
}
if (url.match(/^http:\/\//)) {
url = url.replace(/^http:\/\//, '');
}
var parts = url.split('/');
img.src = 'http://s2.googleusercontent.com/s2/favicons?domain='+parts[0];
}
},
Click: function() {
console.log('-> Bookmark.Click');
// should check for already opened settings here...
var bookmark_url = window.localStorage.getItem('toolbar_bookmark_url');
if (bookmark_url) {
if (!bookmark_url.match(/^chrome:/) && !bookmark_url.match(/http:\/\//)) {
bookmark_url = 'http://'+bookmark_url;
}
chrome.tabs.create({url: bookmark_url});
} else {
chrome.tabs.create({url: chrome.extension.getURL('settings.html')});
}
}
};
// add listener to communicate with settings page
chrome.extension.onRequest.addListener(
function(request, sender, sendResponse) {
if (request.action === 'reset_icon') {
Bookmark.icon.reset();
}
if (request.action === 'save_bookmark') {
Bookmark.Update(request);
}
}
);
// bind Iconv click event
chrome.browserAction.onClicked.addListener(function(tab){
Bookmark.Click();
});
chrome.browserAction.setTitle({title: chrome.i18n.getMessage('goto_bookmark')});
//chrome.browserAction.setBadgeText({text: chrome.i18n.getMessage('goto_bookmark')});
Bookmark.icon.load();