调用active tab js func

This commit is contained in:
go0p
2024-05-15 14:43:04 +08:00
committed by go0p
parent 0c8f82b441
commit e150379c7f
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"});
});