hrtools/background/worker.js

27 lines
453 B
JavaScript
Raw Normal View History

2021-04-26 10:42:12 +00:00
console.log("background");
2021-04-30 10:51:42 +00:00
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
console.log(msg, sender)
if(msg.name === "boss") { // boss
// 创建一个tab 然后注入脚本
chrome.tabs.create({ url: "https://signup.zhipin.com/" }, function (tab) {
chrome.tabs.executeScript(tab.id, { runAt: "document_end", file: "background/boss.js" });
});
2021-04-30 10:51:42 +00:00
}
2021-04-27 10:36:08 +00:00
// sendResponse({});
2021-04-26 10:42:12 +00:00
});