(str: string)
| 7 | * @returns 是否成功发送 |
| 8 | */ |
| 9 | export 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 | * 从命令行参数中处理自定义协议 |
no test coverage detected