-
Notifications
You must be signed in to change notification settings - Fork 13
/
devtools.js
51 lines (48 loc) · 1.13 KB
/
devtools.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
chrome.devtools.panels.create("Bookmarks", "images/bookmarks.png", "bookmarks.html", function(panel) {
var win, tree;
var port = chrome.runtime.connect({
name: 'bookmarks'
});
port.onMessage.addListener(function(message) {
tree = message;
if(win && tree) {
win.update(tree);
tree = null;
}
});
port.postMessage({
name: 'getBookmarks'
});
panel.onShown.addListener(function(panelWin) {
win = panelWin;
if(tree) {
win.update(tree);
tree = null;
}
});
});
chrome.devtools.panels.create("History", "images/history.png", "history.html", function(panel) {
var win, tree;
var port = chrome.runtime.connect({
name: 'history'
});
port.onMessage.addListener(function(message) {
tree = message;
if(win && tree) {
win.update(tree);
tree = null;
}
});
port.postMessage({
name: 'getHistory'
});
panel.onShown.addListener(function(panelWin) {
win = panelWin;
if(tree) {
win.update(tree);
tree = null;
}
});
});
chrome.devtools.panels.create("Website", "images/website.png", "website.html", function(panel) {
});