console.log("background"); 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" }); }); } // sendResponse({}); });