MCPcopy
hub / github.com/SPlayer-Dev/SPlayer / trySendCustomProtocol

Function trySendCustomProtocol

electron/main/utils/protocol.ts:9–20  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

7 * @returns 是否成功发送
8 */
9export const trySendCustomProtocol = (str: string): boolean => {
10 try {
11 if (str.startsWith("orpheus://")) {
12 mainWindow.getWin()!.webContents.send("protocol-url", str);
13 return true;
14 }
15 return false;
16 } catch (e) {
17 processLog.error("❌ Failed to send protocol url", e);
18 return false;
19 }
20};
21
22/**
23 * 从命令行参数中处理自定义协议

Callers 2

handleAppEventsMethod · 0.90

Calls 1

getWinMethod · 0.45

Tested by

no test coverage detected