-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
background.js
executable file
·49 lines (37 loc) · 1.1 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
// chrome.runtime.onInstalled.addListener(function() {
// chrome.tabs.create({
// url: 'https://wordlehint.com/',
// active: true
// });
// return false;
// });
console.log(1)
chrome.runtime.onConnect.addListener(function(port) {
let {id} = port.sender.tab
// chrome.tabs.sendMessage(id, {action: "test"}, () => {})
// ports[id] = port
// console.log({port})
// console.assert(port.name === "gql");
// if(apiHeader){
// port.postMessage({action: "apiHeader", header: apiHeader})
// }
console.log({port, id})
// port.onMessage.addListener(function(msg) {
// console.log(3)
// console.log(msg)
// chrome.tabs.sendMessage(id, msg, () => {})
// })
})
console.log(2)
// chrome.runtime.sendMessage({
// msg: "something_completed",
// data: {
// subject: "Loading",
// content: "Just completed!"
// }
// });
// chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
// console.log(message.data);
// chrome.runtime.sendMessage({ data: "xxx" }, function (response) {
// });
// });