The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 03:37 UTC
| 1 | import { ipcRenderer } from "electron"; |
| 2 | |
| 3 | import { |
| 4 | PASSKEY_BRIDGE_ARGUMENT, |
| 5 | PRIMARY_PASTE_DISABLED_ARGUMENT, |
| 6 | } from "./preview/GuestProtocol.ts"; |
| 7 | import { installPasskeyBridge } from "./preview/PasskeyBridge.ts"; |
| 8 | import "./preview/PickPreload.ts"; |
| 9 | |
| 10 | // Electron hands webPreferences.additionalArguments to sandboxed preloads in process.argv. |
| 11 | if (process.argv.includes(PASSKEY_BRIDGE_ARGUMENT)) { |
| 12 | installPasskeyBridge((channel, publicKey) => ipcRenderer.invoke(channel, publicKey)); |
| 13 | } |
| 14 | |
| 15 | if (process.argv.includes(PRIMARY_PASTE_DISABLED_ARGUMENT)) { |
| 16 | // Same guard as the app preload: Blink pastes PRIMARY on an uncancelled middle mouseup. |
| 17 | window.addEventListener( |
| 18 | "mouseup", |
| 19 | (event) => { |
| 20 | if (event.button === 1) event.preventDefault(); |
| 21 | }, |
| 22 | true, |
| 23 | ); |
| 24 | } |