-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.js
36 lines (32 loc) · 1.03 KB
/
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
let btn1 = document.getElementById('export1')
let btn2 = document.getElementById('export2')
let btn3 = document.getElementById('export3')
let btn4 = document.getElementById('export4')
btn1.onclick = function() {
chrome.tabs.getSelected(null, function (tab) {
chrome.tabs.sendMessage(tab.id, {command: "export1"}, function(response) {
console.log(response)
});
})
}
btn2.onclick = function() {
chrome.tabs.getSelected(null, function (tab) {
chrome.tabs.sendMessage(tab.id, {command: "export2"}, function(response) {
console.log(response)
});
})
}
btn3.onclick = function() {
chrome.tabs.getSelected(null, function (tab) {
chrome.tabs.sendMessage(tab.id, {command: "export3"}, function(response) {
console.log(response)
});
})
}
btn4.onclick = function() {
chrome.tabs.getSelected(null, function (tab) {
chrome.tabs.sendMessage(tab.id, {command: "export4"}, function(response) {
console.log(response)
});
})
}