TODO: create tab

This commit is contained in:
eson 2021-04-30 18:51:42 +08:00
parent fd8a3f2b24
commit 32fcc9deb3
2 changed files with 6 additions and 3 deletions

View File

@ -1,7 +1,10 @@
console.log("background");
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
console.log(request, sender)
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
console.log(msg, sender)
if(msg.name === "boss") { // boss
chrome.tabs.cre // 创建一个tab 然后注入脚本
}
// sendResponse({});
});

View File

@ -16,7 +16,7 @@ if( window.location.href === "http://localhost:12203/start") {
// }
chrome.runtime.sendMessage(JSON.parse(evt.data))
};
ws.onclose = function(evt) {