MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / connect

Method connect

packages/message/extension_message.ts:10–16  ·  view source on GitHub ↗
(data: TMessage)

Source from the content-addressed store, hash-verified

8 constructor(private backgroundPrimary = false) {}
9
10 connect(data: TMessage): Promise<MessageConnect> {
11 return new Promise((resolve) => {
12 const con = chrome.runtime.connect();
13 con.postMessage(data);
14 resolve(new ExtensionMessageConnect(con));
15 });
16 }
17
18 // 发送消息 注意不进行回调的内存泄漏
19 sendMessage<T = any>(data: TMessage): Promise<T> {

Callers

nothing calls this directly

Calls 2

connectMethod · 0.65
postMessageMethod · 0.65

Tested by

no test coverage detected