(event?: Electron.IpcMainEvent | Electron.IpcMainInvokeEvent)
| 294 | } |
| 295 | |
| 296 | private subInputSelect(event?: Electron.IpcMainEvent | Electron.IpcMainInvokeEvent): boolean { |
| 297 | try { |
| 298 | const targetWindow = event |
| 299 | ? detachedWindowManager.getWindowByPluginWebContents(event.sender.id) || this.mainWindow |
| 300 | : this.mainWindow |
| 301 | |
| 302 | if (!targetWindow) { |
| 303 | console.warn('[PluginUI] 无法找到目标窗口') |
| 304 | return false |
| 305 | } |
| 306 | |
| 307 | targetWindow.webContents.focus() |
| 308 | targetWindow.webContents.send('select-sub-input') |
| 309 | |
| 310 | return true |
| 311 | } catch (error: unknown) { |
| 312 | console.error('[PluginUI] 选中子输入框失败:', error) |
| 313 | return false |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | private hidePlugin(): void { |
| 318 | if (this.pluginManager) { |
no test coverage detected