调用active tab js func

This commit is contained in:
go0p
2024-05-13 15:01:38 +08:00
parent 95bb29d216
commit fffbb2a0a0
6 changed files with 99 additions and 87 deletions
+10 -11
View File
@@ -81,16 +81,15 @@ const pageFunction = (code) => {
// });
// });
// chrome.runtime.onConnect.addListener(function (port) {
// console.assert(port.name === "content-script");
// port.onMessage.addListener(function (msg) {
// console.log("on connect", msg)
// });
// port.onDisconnect.addListener(function () {
// console.error("Disconnected from port.");
// });
// // port.postMessage({action: "TEST POST MESSAGE"});
//
// });
chrome.runtime.onConnect.addListener(function (port) {
console.assert(port.name === "content-to-ex");
port.onMessage.addListener(function (msg) {
console.log("[content-to-ex]", msg)
});
port.onDisconnect.addListener(function () {
console.error("[content-to-ex] Disconnected from port.");
});
// port.postMessage({action: "TEST POST MESSAGE"});
});