MCPcopy Create free account
hub / github.com/ZToolsCenter/ZTools / isDetachedWindowCall

Method isDetachedWindowCall

src/main/api/plugin/input.ts:244–250  ·  view source on GitHub ↗

* 检查调用者是否为分离窗口且聚焦(安全检查:分离窗口不应执行粘贴/输入操作)

(event: Electron.IpcMainEvent)

Source from the content-addressed store, hash-verified

242 * 检查调用者是否为分离窗口且聚焦(安全检查:分离窗口不应执行粘贴/输入操作)
243 */
244 private isDetachedWindowCall(event: Electron.IpcMainEvent): boolean {
245 const win = BrowserWindow.fromWebContents(event.sender)
246 if (win && win !== this.windowManager?.getMainWindow() && win.isFocused()) {
247 return true
248 }
249 return false
250 }
251
252 private sendInputEvent(
253 inputEvent:

Callers 1

setupIPCMethod · 0.95

Calls 1

getMainWindowMethod · 0.80

Tested by

no test coverage detected