mirror of
https://github.com/yaklang/yaklang-chrome-extension.git
synced 2026-09-26 21:21:53 +08:00
调用active tab js func
This commit is contained in:
+10
-11
@@ -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"});
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user