@vforsh/argus 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/argus.js +6265 -6005
- package/dist/cdp/resolveCdpEndpoint.d.ts.map +1 -1
- package/dist/cdp/resolveCdpEndpoint.js +2 -1
- package/dist/cdp/resolveCdpEndpoint.js.map +1 -1
- package/dist/cli/defineCommand.d.ts +12 -0
- package/dist/cli/defineCommand.d.ts.map +1 -1
- package/dist/cli/defineCommand.js +71 -1
- package/dist/cli/defineCommand.js.map +1 -1
- package/dist/cli/defineWatcherCommand.d.ts +12 -54
- package/dist/cli/defineWatcherCommand.d.ts.map +1 -1
- package/dist/cli/defineWatcherCommand.js +1 -1
- package/dist/cli/defineWatcherCommand.js.map +1 -1
- package/dist/cli/parse.d.ts +1 -2
- package/dist/cli/parse.d.ts.map +1 -1
- package/dist/cli/parse.js +2 -10
- package/dist/cli/parse.js.map +1 -1
- package/dist/cli/plugins/pluginHost.d.ts.map +1 -1
- package/dist/cli/plugins/pluginHost.js +1 -1
- package/dist/cli/plugins/pluginHost.js.map +1 -1
- package/dist/cli/plugins/registerPlugins.d.ts.map +1 -1
- package/dist/cli/plugins/registerPlugins.js +10 -8
- package/dist/cli/plugins/registerPlugins.js.map +1 -1
- package/dist/cli/program.d.ts +11 -1
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +18 -9
- package/dist/cli/program.js.map +1 -1
- package/dist/cli/register/authCommands.d.ts.map +1 -1
- package/dist/cli/register/authCommands.js +8 -7
- package/dist/cli/register/authCommands.js.map +1 -1
- package/dist/cli/register/chromeCommands.d.ts.map +1 -1
- package/dist/cli/register/chromeCommands.js +12 -27
- package/dist/cli/register/chromeCommands.js.map +1 -1
- package/dist/cli/register/codeCommands.d.ts.map +1 -1
- package/dist/cli/register/codeCommands.js +7 -6
- package/dist/cli/register/codeCommands.js.map +1 -1
- package/dist/cli/register/dialogCommands.d.ts.map +1 -1
- package/dist/cli/register/dialogCommands.js +3 -2
- package/dist/cli/register/dialogCommands.js.map +1 -1
- package/dist/cli/register/domCommandBuilder.d.ts.map +1 -1
- package/dist/cli/register/domCommandBuilder.js +2 -1
- package/dist/cli/register/domCommandBuilder.js.map +1 -1
- package/dist/cli/register/domCommands.d.ts.map +1 -1
- package/dist/cli/register/domCommands.js +7 -6
- package/dist/cli/register/domCommands.js.map +1 -1
- package/dist/cli/register/evalCommands.d.ts.map +1 -1
- package/dist/cli/register/evalCommands.js +27 -57
- package/dist/cli/register/evalCommands.js.map +1 -1
- package/dist/cli/register/extensionCommands.d.ts.map +1 -1
- package/dist/cli/register/extensionCommands.js +1 -1
- package/dist/cli/register/extensionCommands.js.map +1 -1
- package/dist/cli/register/fillCommand.d.ts.map +1 -1
- package/dist/cli/register/fillCommand.js +5 -5
- package/dist/cli/register/fillCommand.js.map +1 -1
- package/dist/cli/register/hoverCommand.d.ts.map +1 -1
- package/dist/cli/register/hoverCommand.js +2 -1
- package/dist/cli/register/hoverCommand.js.map +1 -1
- package/dist/cli/register/index.d.ts.map +1 -1
- package/dist/cli/register/index.js +2 -0
- package/dist/cli/register/index.js.map +1 -1
- package/dist/cli/register/keydownCommand.d.ts.map +1 -1
- package/dist/cli/register/keydownCommand.js +2 -1
- package/dist/cli/register/keydownCommand.js.map +1 -1
- package/dist/cli/register/locateCommands.d.ts.map +1 -1
- package/dist/cli/register/locateCommands.js +2 -1
- package/dist/cli/register/locateCommands.js.map +1 -1
- package/dist/cli/register/logsCommands.d.ts.map +1 -1
- package/dist/cli/register/logsCommands.js +8 -10
- package/dist/cli/register/logsCommands.js.map +1 -1
- package/dist/cli/register/netCommands.d.ts +0 -5
- package/dist/cli/register/netCommands.d.ts.map +1 -1
- package/dist/cli/register/netCommands.js +17 -143
- package/dist/cli/register/netCommands.js.map +1 -1
- package/dist/cli/register/pageCommands.d.ts.map +1 -1
- package/dist/cli/register/pageCommands.js +8 -7
- package/dist/cli/register/pageCommands.js.map +1 -1
- package/dist/cli/register/pluginCommands.d.ts.map +1 -1
- package/dist/cli/register/pluginCommands.js +3 -2
- package/dist/cli/register/pluginCommands.js.map +1 -1
- package/dist/cli/register/quickAccessCommands.d.ts.map +1 -1
- package/dist/cli/register/quickAccessCommands.js +16 -31
- package/dist/cli/register/quickAccessCommands.js.map +1 -1
- package/dist/cli/register/recordCommands.d.ts.map +1 -1
- package/dist/cli/register/recordCommands.js +12 -34
- package/dist/cli/register/recordCommands.js.map +1 -1
- package/dist/cli/register/scrollToCommand.d.ts.map +1 -1
- package/dist/cli/register/scrollToCommand.js +2 -1
- package/dist/cli/register/scrollToCommand.js.map +1 -1
- package/dist/cli/register/sessionCommands.d.ts +3 -0
- package/dist/cli/register/sessionCommands.d.ts.map +1 -0
- package/dist/cli/register/sessionCommands.js +24 -0
- package/dist/cli/register/sessionCommands.js.map +1 -0
- package/dist/cli/register/sharedOptions.d.ts +11 -0
- package/dist/cli/register/sharedOptions.d.ts.map +1 -0
- package/dist/cli/register/sharedOptions.js +10 -0
- package/dist/cli/register/sharedOptions.js.map +1 -0
- package/dist/cli/register/skillCommands.d.ts.map +1 -1
- package/dist/cli/register/skillCommands.js +2 -1
- package/dist/cli/register/skillCommands.js.map +1 -1
- package/dist/cli/register/snapshotCommands.d.ts.map +1 -1
- package/dist/cli/register/snapshotCommands.js +3 -2
- package/dist/cli/register/snapshotCommands.js.map +1 -1
- package/dist/cli/register/storageCommands.d.ts.map +1 -1
- package/dist/cli/register/storageCommands.js +2 -1
- package/dist/cli/register/storageCommands.js.map +1 -1
- package/dist/cli/register/throttleCommands.d.ts.map +1 -1
- package/dist/cli/register/throttleCommands.js +4 -3
- package/dist/cli/register/throttleCommands.js.map +1 -1
- package/dist/cli/register/traceCommands.d.ts.map +1 -1
- package/dist/cli/register/traceCommands.js +10 -30
- package/dist/cli/register/traceCommands.js.map +1 -1
- package/dist/cli/register/watcherCommands.d.ts.map +1 -1
- package/dist/cli/register/watcherCommands.js +12 -24
- package/dist/cli/register/watcherCommands.js.map +1 -1
- package/dist/cli/validation.d.ts +14 -0
- package/dist/cli/validation.d.ts.map +1 -1
- package/dist/cli/validation.js +17 -6
- package/dist/cli/validation.js.map +1 -1
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +3 -2
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/authCookieSupport.d.ts +4 -2
- package/dist/commands/authCookieSupport.d.ts.map +1 -1
- package/dist/commands/authCookieSupport.js +0 -4
- package/dist/commands/authCookieSupport.js.map +1 -1
- package/dist/commands/authCookies.d.ts +4 -4
- package/dist/commands/authCookies.d.ts.map +1 -1
- package/dist/commands/chrome/authState.d.ts +0 -12
- package/dist/commands/chrome/authState.d.ts.map +1 -1
- package/dist/commands/chrome/authState.js +0 -14
- package/dist/commands/chrome/authState.js.map +1 -1
- package/dist/commands/chrome/browser.d.ts.map +1 -1
- package/dist/commands/chrome/browser.js +2 -1
- package/dist/commands/chrome/browser.js.map +1 -1
- package/dist/commands/chrome/shared.d.ts.map +1 -1
- package/dist/commands/chrome/shared.js +3 -2
- package/dist/commands/chrome/shared.js.map +1 -1
- package/dist/commands/chrome/targets.d.ts.map +1 -1
- package/dist/commands/chrome/targets.js +6 -5
- package/dist/commands/chrome/targets.js.map +1 -1
- package/dist/commands/chromeStart.d.ts +10 -0
- package/dist/commands/chromeStart.d.ts.map +1 -1
- package/dist/commands/chromeStart.js +50 -41
- package/dist/commands/chromeStart.js.map +1 -1
- package/dist/commands/code.d.ts +2 -2
- package/dist/commands/code.d.ts.map +1 -1
- package/dist/commands/codeEdit.d.ts.map +1 -1
- package/dist/commands/codeEdit.js +3 -2
- package/dist/commands/codeEdit.js.map +1 -1
- package/dist/commands/configInit.d.ts +1 -0
- package/dist/commands/configInit.d.ts.map +1 -1
- package/dist/commands/configInit.js +17 -14
- package/dist/commands/configInit.js.map +1 -1
- package/dist/commands/dialog.d.ts +4 -4
- package/dist/commands/dialog.d.ts.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +14 -10
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/dom/shared.js +1 -1
- package/dist/commands/dom/shared.js.map +1 -1
- package/dist/commands/domAdd.d.ts +1 -1
- package/dist/commands/domAdd.d.ts.map +1 -1
- package/dist/commands/domAdd.js +10 -54
- package/dist/commands/domAdd.js.map +1 -1
- package/dist/commands/domAddScript.d.ts.map +1 -1
- package/dist/commands/domAddScript.js +14 -58
- package/dist/commands/domAddScript.js.map +1 -1
- package/dist/commands/domClick.d.ts +1 -2
- package/dist/commands/domClick.d.ts.map +1 -1
- package/dist/commands/domClick.js +2 -4
- package/dist/commands/domClick.js.map +1 -1
- package/dist/commands/domDrag.d.ts +1 -2
- package/dist/commands/domDrag.d.ts.map +1 -1
- package/dist/commands/domDrag.js +3 -5
- package/dist/commands/domDrag.js.map +1 -1
- package/dist/commands/domFill.d.ts +1 -1
- package/dist/commands/domFill.d.ts.map +1 -1
- package/dist/commands/domFill.js +10 -42
- package/dist/commands/domFill.js.map +1 -1
- package/dist/commands/domFocus.d.ts +1 -1
- package/dist/commands/domFocus.d.ts.map +1 -1
- package/dist/commands/domHover.d.ts +1 -1
- package/dist/commands/domHover.d.ts.map +1 -1
- package/dist/commands/domInfo.d.ts +1 -1
- package/dist/commands/domInfo.d.ts.map +1 -1
- package/dist/commands/domKeydown.d.ts +1 -1
- package/dist/commands/domKeydown.d.ts.map +1 -1
- package/dist/commands/domModify.d.ts.map +1 -1
- package/dist/commands/domModify.js +6 -7
- package/dist/commands/domModify.js.map +1 -1
- package/dist/commands/domRemove.d.ts +1 -1
- package/dist/commands/domRemove.d.ts.map +1 -1
- package/dist/commands/domScroll.d.ts +1 -1
- package/dist/commands/domScroll.d.ts.map +1 -1
- package/dist/commands/domScroll.js +16 -10
- package/dist/commands/domScroll.js.map +1 -1
- package/dist/commands/domScrollTo.d.ts +1 -1
- package/dist/commands/domScrollTo.d.ts.map +1 -1
- package/dist/commands/domSetFile.d.ts +1 -1
- package/dist/commands/domSetFile.d.ts.map +1 -1
- package/dist/commands/domTree.d.ts +1 -1
- package/dist/commands/domTree.d.ts.map +1 -1
- package/dist/commands/eval.d.ts +3 -32
- package/dist/commands/eval.d.ts.map +1 -1
- package/dist/commands/eval.js +14 -33
- package/dist/commands/eval.js.map +1 -1
- package/dist/commands/evalBundle.js +2 -1
- package/dist/commands/evalBundle.js.map +1 -1
- package/dist/commands/evalEmit.d.ts +35 -0
- package/dist/commands/evalEmit.d.ts.map +1 -0
- package/dist/commands/evalEmit.js +65 -0
- package/dist/commands/evalEmit.js.map +1 -0
- package/dist/commands/evalIframe.d.ts +16 -0
- package/dist/commands/evalIframe.d.ts.map +1 -0
- package/dist/commands/evalIframe.js +37 -0
- package/dist/commands/evalIframe.js.map +1 -0
- package/dist/commands/evalShared.d.ts +52 -44
- package/dist/commands/evalShared.d.ts.map +1 -1
- package/dist/commands/evalShared.js +64 -192
- package/dist/commands/evalShared.js.map +1 -1
- package/dist/commands/evalUntil.d.ts +4 -32
- package/dist/commands/evalUntil.d.ts.map +1 -1
- package/dist/commands/evalUntil.js +9 -29
- package/dist/commands/evalUntil.js.map +1 -1
- package/dist/commands/extension/attach.d.ts.map +1 -1
- package/dist/commands/extension/attach.js +12 -28
- package/dist/commands/extension/attach.js.map +1 -1
- package/dist/commands/extension/doctor.d.ts.map +1 -1
- package/dist/commands/extension/doctor.js +1 -1
- package/dist/commands/extension/doctor.js.map +1 -1
- package/dist/commands/extension/failures.d.ts +62 -0
- package/dist/commands/extension/failures.d.ts.map +1 -0
- package/dist/commands/extension/failures.js +70 -0
- package/dist/commands/extension/failures.js.map +1 -0
- package/dist/commands/extension/info.d.ts.map +1 -1
- package/dist/commands/extension/info.js +4 -14
- package/dist/commands/extension/info.js.map +1 -1
- package/dist/commands/extension/install.d.ts.map +1 -1
- package/dist/commands/extension/install.js +12 -22
- package/dist/commands/extension/install.js.map +1 -1
- package/dist/commands/extension/nativeHost.d.ts +22 -0
- package/dist/commands/extension/nativeHost.d.ts.map +1 -1
- package/dist/commands/extension/nativeHost.js +38 -7
- package/dist/commands/extension/nativeHost.js.map +1 -1
- package/dist/commands/extension/remove.d.ts.map +1 -1
- package/dist/commands/extension/remove.js +5 -15
- package/dist/commands/extension/remove.js.map +1 -1
- package/dist/commands/extension/resolveExtensionWatcher.d.ts.map +1 -1
- package/dist/commands/extension/resolveExtensionWatcher.js +3 -2
- package/dist/commands/extension/resolveExtensionWatcher.js.map +1 -1
- package/dist/commands/extension/select.js +11 -23
- package/dist/commands/extension/select.js.map +1 -1
- package/dist/commands/extension/setup.d.ts.map +1 -1
- package/dist/commands/extension/setup.js +8 -30
- package/dist/commands/extension/setup.js.map +1 -1
- package/dist/commands/extension/show.d.ts.map +1 -1
- package/dist/commands/extension/show.js +10 -17
- package/dist/commands/extension/show.js.map +1 -1
- package/dist/commands/extension/status.d.ts.map +1 -1
- package/dist/commands/extension/status.js +5 -14
- package/dist/commands/extension/status.js.map +1 -1
- package/dist/commands/extension/tabAttach.d.ts.map +1 -1
- package/dist/commands/extension/tabAttach.js +2 -2
- package/dist/commands/extension/tabAttach.js.map +1 -1
- package/dist/commands/extension/tabSelection.d.ts.map +1 -1
- package/dist/commands/extension/tabSelection.js +1 -1
- package/dist/commands/extension/tabSelection.js.map +1 -1
- package/dist/commands/extension/tabWatcher.d.ts +7 -1
- package/dist/commands/extension/tabWatcher.d.ts.map +1 -1
- package/dist/commands/extension/tabWatcher.js +17 -21
- package/dist/commands/extension/tabWatcher.js.map +1 -1
- package/dist/commands/extension/tabs.d.ts.map +1 -1
- package/dist/commands/extension/tabs.js +6 -31
- package/dist/commands/extension/tabs.js.map +1 -1
- package/dist/commands/extension/targetSelection.d.ts +10 -25
- package/dist/commands/extension/targetSelection.d.ts.map +1 -1
- package/dist/commands/extension/targetSelection.js +2 -2
- package/dist/commands/extension/targetSelection.js.map +1 -1
- package/dist/commands/extension/targets.js +2 -11
- package/dist/commands/extension/targets.js.map +1 -1
- package/dist/commands/iframeHelper.d.ts +13 -0
- package/dist/commands/iframeHelper.d.ts.map +1 -1
- package/dist/commands/iframeHelper.js +7 -1
- package/dist/commands/iframeHelper.js.map +1 -1
- package/dist/commands/inputSource.d.ts +57 -0
- package/dist/commands/inputSource.d.ts.map +1 -0
- package/dist/commands/inputSource.js +75 -0
- package/dist/commands/inputSource.js.map +1 -0
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +14 -6
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/logs.d.ts +3 -3
- package/dist/commands/logs.d.ts.map +1 -1
- package/dist/commands/net.d.ts +1 -1
- package/dist/commands/net.d.ts.map +1 -1
- package/dist/commands/netClear.d.ts +1 -1
- package/dist/commands/netClear.d.ts.map +1 -1
- package/dist/commands/netExport.d.ts.map +1 -1
- package/dist/commands/netExport.js +9 -31
- package/dist/commands/netExport.js.map +1 -1
- package/dist/commands/netInspect.d.ts.map +1 -1
- package/dist/commands/netInspect.js +2 -1
- package/dist/commands/netInspect.js.map +1 -1
- package/dist/commands/netMock.d.ts +4 -4
- package/dist/commands/netMock.d.ts.map +1 -1
- package/dist/commands/netMock.js +2 -2
- package/dist/commands/netMock.js.map +1 -1
- package/dist/commands/netRequestClient.d.ts +2 -2
- package/dist/commands/netRequestClient.d.ts.map +1 -1
- package/dist/commands/netRequestClient.js.map +1 -1
- package/dist/commands/netShared.d.ts +22 -0
- package/dist/commands/netShared.d.ts.map +1 -1
- package/dist/commands/netShared.js +43 -16
- package/dist/commands/netShared.js.map +1 -1
- package/dist/commands/netSse.d.ts +1 -1
- package/dist/commands/netSse.d.ts.map +1 -1
- package/dist/commands/netSummary.js +6 -25
- package/dist/commands/netSummary.js.map +1 -1
- package/dist/commands/netWebSocket.d.ts +2 -2
- package/dist/commands/netWebSocket.d.ts.map +1 -1
- package/dist/commands/page.d.ts +8 -0
- package/dist/commands/page.d.ts.map +1 -1
- package/dist/commands/page.js +83 -83
- package/dist/commands/page.js.map +1 -1
- package/dist/commands/pageEmulation.d.ts +3 -3
- package/dist/commands/pageEmulation.d.ts.map +1 -1
- package/dist/commands/pageEmulation.js +17 -12
- package/dist/commands/pageEmulation.js.map +1 -1
- package/dist/commands/pluginConfig.d.ts.map +1 -1
- package/dist/commands/pluginConfig.js +21 -20
- package/dist/commands/pluginConfig.js.map +1 -1
- package/dist/commands/record.d.ts +3 -3
- package/dist/commands/record.d.ts.map +1 -1
- package/dist/commands/record.js +1 -1
- package/dist/commands/record.js.map +1 -1
- package/dist/commands/reload.d.ts +1 -1
- package/dist/commands/reload.d.ts.map +1 -1
- package/dist/commands/resolveTestId.d.ts.map +1 -1
- package/dist/commands/resolveTestId.js +2 -3
- package/dist/commands/resolveTestId.js.map +1 -1
- package/dist/commands/screenshot.d.ts +1 -1
- package/dist/commands/screenshot.d.ts.map +1 -1
- package/dist/commands/snapshot.d.ts +1 -1
- package/dist/commands/snapshot.d.ts.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +6 -28
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/startShared.d.ts.map +1 -1
- package/dist/commands/startShared.js +2 -1
- package/dist/commands/startShared.js.map +1 -1
- package/dist/commands/throttle.d.ts +3 -3
- package/dist/commands/throttle.d.ts.map +1 -1
- package/dist/commands/throttle.js +2 -3
- package/dist/commands/throttle.js.map +1 -1
- package/dist/commands/trace.d.ts.map +1 -1
- package/dist/commands/trace.js +2 -2
- package/dist/commands/trace.js.map +1 -1
- package/dist/commands/watcherNativeHost.d.ts.map +1 -1
- package/dist/commands/watcherNativeHost.js +4 -1
- package/dist/commands/watcherNativeHost.js.map +1 -1
- package/dist/commands/watcherPrune.d.ts.map +1 -1
- package/dist/commands/watcherPrune.js +3 -3
- package/dist/commands/watcherPrune.js.map +1 -1
- package/dist/commands/watcherSession.d.ts.map +1 -1
- package/dist/commands/watcherSession.js +2 -1
- package/dist/commands/watcherSession.js.map +1 -1
- package/dist/commands/watcherStatus.d.ts +1 -1
- package/dist/commands/watcherStatus.d.ts.map +1 -1
- package/dist/commands/watcherStatus.js +5 -0
- package/dist/commands/watcherStatus.js.map +1 -1
- package/dist/commands/watcherStop.d.ts.map +1 -1
- package/dist/commands/watcherStop.js +2 -2
- package/dist/commands/watcherStop.js.map +1 -1
- package/dist/config/configContext.d.ts +27 -0
- package/dist/config/configContext.d.ts.map +1 -0
- package/dist/config/configContext.js +57 -0
- package/dist/config/configContext.js.map +1 -0
- package/dist/config/loadConfig.d.ts.map +1 -1
- package/dist/config/loadConfig.js +3 -2
- package/dist/config/loadConfig.js.map +1 -1
- package/dist/eval/evalClient.d.ts.map +1 -1
- package/dist/eval/evalClient.js +2 -1
- package/dist/eval/evalClient.js.map +1 -1
- package/dist/extension/dist/background/service-worker.js +465 -448
- package/dist/extension/dist/background/service-worker.js.map +4 -4
- package/dist/extension/dist/popup/popup.js +279 -234
- package/dist/extension/dist/popup/popup.js.map +4 -4
- package/dist/extension/manifest.json +1 -1
- package/dist/internal.d.ts +22 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +22 -0
- package/dist/internal.js.map +1 -0
- package/dist/output/io.d.ts +15 -9
- package/dist/output/io.d.ts.map +1 -1
- package/dist/output/io.js +21 -2
- package/dist/output/io.js.map +1 -1
- package/dist/registry.d.ts +1 -4
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +4 -25
- package/dist/registry.js.map +1 -1
- package/dist/runtime-code/format.d.ts.map +1 -1
- package/dist/runtime-code/format.js +2 -1
- package/dist/runtime-code/format.js.map +1 -1
- package/dist/session/runSession.d.ts +15 -0
- package/dist/session/runSession.d.ts.map +1 -0
- package/dist/session/runSession.js +184 -0
- package/dist/session/runSession.js.map +1 -0
- package/dist/session/sessionArgv.d.ts +42 -0
- package/dist/session/sessionArgv.d.ts.map +1 -0
- package/dist/session/sessionArgv.js +224 -0
- package/dist/session/sessionArgv.js.map +1 -0
- package/dist/session/sessionDispatch.d.ts +21 -0
- package/dist/session/sessionDispatch.d.ts.map +1 -0
- package/dist/session/sessionDispatch.js +137 -0
- package/dist/session/sessionDispatch.js.map +1 -0
- package/dist/session/stdioCapture.d.ts +33 -0
- package/dist/session/stdioCapture.d.ts.map +1 -0
- package/dist/session/stdioCapture.js +56 -0
- package/dist/session/stdioCapture.js.map +1 -0
- package/dist/skill/argus/SKILL.md +29 -0
- package/dist/skill/argus/reference/SESSION.md +153 -0
- package/dist/watchers/queryParams.d.ts +11 -9
- package/dist/watchers/queryParams.d.ts.map +1 -1
- package/dist/watchers/queryParams.js +63 -86
- package/dist/watchers/queryParams.js.map +1 -1
- package/dist/watchers/requestWatcher.d.ts +7 -25
- package/dist/watchers/requestWatcher.d.ts.map +1 -1
- package/dist/watchers/requestWatcher.js +9 -6
- package/dist/watchers/requestWatcher.js.map +1 -1
- package/dist/watchers/resolveWatcher.d.ts.map +1 -1
- package/dist/watchers/resolveWatcher.js +9 -2
- package/dist/watchers/resolveWatcher.js.map +1 -1
- package/package.json +9 -5
- package/dist/time.d.ts +0 -3
- package/dist/time.d.ts.map +0 -1
- package/dist/time.js +0 -19
- package/dist/time.js.map +0 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// src/popup/html.ts
|
|
2
|
+
var escapeHtml = (text) => text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
3
|
+
|
|
1
4
|
// src/popup/classify-target.ts
|
|
2
5
|
var LOW_INTEREST_URL_RULES = [
|
|
3
6
|
{ host: "accounts.google.com", pathPrefix: "/RotateCookiesPage" },
|
|
@@ -165,12 +168,192 @@ function renderTargetVisibilityAction(tabId, target, visibility) {
|
|
|
165
168
|
function isTargetSelected(selectedFrameId, targetFrameId) {
|
|
166
169
|
return selectedFrameId !== void 0 && (selectedFrameId ?? null) === (targetFrameId ?? null);
|
|
167
170
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
return
|
|
171
|
+
|
|
172
|
+
// src/popup/popup-client.ts
|
|
173
|
+
var sendPopupMessage = async (message) => {
|
|
174
|
+
return new Promise((resolve) => {
|
|
175
|
+
chrome.runtime.sendMessage(message, resolve);
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
var runPopupMessage = async (message) => {
|
|
179
|
+
const response = await sendPopupMessage(message);
|
|
180
|
+
if (!response.success) {
|
|
181
|
+
throw new Error(response.error);
|
|
182
|
+
}
|
|
183
|
+
return response;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
// src/popup/health-panel.ts
|
|
187
|
+
var healthSummary = document.getElementById("healthSummary");
|
|
188
|
+
var healthNativeHost = document.getElementById("healthNativeHost");
|
|
189
|
+
var healthWatcherReady = document.getElementById("healthWatcherReady");
|
|
190
|
+
var healthWatcherId = document.getElementById("healthWatcherId");
|
|
191
|
+
var healthAttachedCount = document.getElementById("healthAttachedCount");
|
|
192
|
+
var healthSelectedTarget = document.getElementById("healthSelectedTarget");
|
|
193
|
+
var healthLastMessage = document.getElementById("healthLastMessage");
|
|
194
|
+
var healthPid = document.getElementById("healthPid");
|
|
195
|
+
var updateHealth = (status, watcher, buttons, hasWatchers) => {
|
|
196
|
+
const target = watcher?.currentTarget ?? null;
|
|
197
|
+
const tabCount = status?.attachedTabs.length ?? 0;
|
|
198
|
+
const nativeHostConnected = watcher?.bridgeConnected ?? status?.bridgeConnected ?? false;
|
|
199
|
+
const watcherReady = watcher?.watcherReady ?? false;
|
|
200
|
+
const targetState = watcher?.targetState ?? "not-selected";
|
|
201
|
+
healthSummary.textContent = buildHealthSummaryText({
|
|
202
|
+
nativeHostConnected,
|
|
203
|
+
watcherReady,
|
|
204
|
+
targetState,
|
|
205
|
+
watcherId: watcher?.watcherId ?? null,
|
|
206
|
+
tabCount
|
|
207
|
+
});
|
|
208
|
+
setHealthValueState(healthNativeHost, nativeHostConnected ? "Connected" : "Disconnected", nativeHostConnected ? "connected" : "disconnected");
|
|
209
|
+
setHealthValueState(healthWatcherReady, watcherReady ? "Ready" : "Not ready", watcherReady ? "connected" : "disconnected");
|
|
210
|
+
healthWatcherId.textContent = watcher?.watcherId ?? "-";
|
|
211
|
+
healthAttachedCount.textContent = String(tabCount);
|
|
212
|
+
setHealthValueState(healthSelectedTarget, formatTargetState(target, targetState), getTargetStateClass(targetState));
|
|
213
|
+
healthLastMessage.textContent = formatRelativeTimestamp(watcher?.lastMessageAt ?? null);
|
|
214
|
+
healthPid.textContent = watcher?.nativeHostPid ? String(watcher.nativeHostPid) : "-";
|
|
215
|
+
buttons.copyAll.disabled = !hasWatchers;
|
|
216
|
+
buttons.detachAll.disabled = !hasWatchers;
|
|
217
|
+
};
|
|
218
|
+
var buildHealthSummaryText = (input) => {
|
|
219
|
+
const parts = [];
|
|
220
|
+
if (input.watcherId) parts.push(input.watcherId);
|
|
221
|
+
parts.push(input.nativeHostConnected ? "Host connected" : "Host disconnected");
|
|
222
|
+
parts.push(input.watcherReady ? "Watcher ready" : "Watcher not ready");
|
|
223
|
+
if (input.targetState === "rebinding") parts.push("Target rebinding");
|
|
224
|
+
if (input.tabCount > 0) parts.push(`${input.tabCount} tab${input.tabCount === 1 ? "" : "s"}`);
|
|
225
|
+
return parts.join(" \xB7 ");
|
|
226
|
+
};
|
|
227
|
+
var setHealthValueState = (element, text, stateClass) => {
|
|
228
|
+
element.textContent = text;
|
|
229
|
+
element.classList.toggle("connected", stateClass === "connected");
|
|
230
|
+
element.classList.toggle("disconnected", stateClass === "disconnected");
|
|
231
|
+
element.classList.toggle("warning", stateClass === "warning");
|
|
232
|
+
};
|
|
233
|
+
var formatTargetState = (target, state) => {
|
|
234
|
+
if (!target || state === "not-selected") {
|
|
235
|
+
return "-";
|
|
236
|
+
}
|
|
237
|
+
const label = target.type === "page" ? "Page" : "Iframe";
|
|
238
|
+
return state === "ready" ? `${label} ready` : `${label} rebinding`;
|
|
239
|
+
};
|
|
240
|
+
var getTargetStateClass = (state) => {
|
|
241
|
+
if (state === "ready") {
|
|
242
|
+
return "connected";
|
|
243
|
+
}
|
|
244
|
+
if (state === "rebinding") {
|
|
245
|
+
return "warning";
|
|
246
|
+
}
|
|
247
|
+
return null;
|
|
248
|
+
};
|
|
249
|
+
function formatRelativeTimestamp(timestamp) {
|
|
250
|
+
if (!timestamp) {
|
|
251
|
+
return "-";
|
|
252
|
+
}
|
|
253
|
+
const elapsedMs = Math.max(0, Date.now() - timestamp);
|
|
254
|
+
if (elapsedMs < 1e3) {
|
|
255
|
+
return "Just now";
|
|
256
|
+
}
|
|
257
|
+
const elapsedSeconds = Math.floor(elapsedMs / 1e3);
|
|
258
|
+
if (elapsedSeconds < 60) {
|
|
259
|
+
return `${elapsedSeconds}s ago`;
|
|
260
|
+
}
|
|
261
|
+
const elapsedMinutes = Math.floor(elapsedSeconds / 60);
|
|
262
|
+
if (elapsedMinutes < 60) {
|
|
263
|
+
return `${elapsedMinutes}m ago`;
|
|
264
|
+
}
|
|
265
|
+
const elapsedHours = Math.floor(elapsedMinutes / 60);
|
|
266
|
+
return `${elapsedHours}h ago`;
|
|
172
267
|
}
|
|
173
268
|
|
|
269
|
+
// src/popup/watcher-info.ts
|
|
270
|
+
async function copyTextToClipboard(text) {
|
|
271
|
+
try {
|
|
272
|
+
await navigator.clipboard.writeText(text);
|
|
273
|
+
return;
|
|
274
|
+
} catch {
|
|
275
|
+
}
|
|
276
|
+
const textarea = document.createElement("textarea");
|
|
277
|
+
textarea.value = text;
|
|
278
|
+
textarea.setAttribute("readonly", "true");
|
|
279
|
+
textarea.style.position = "fixed";
|
|
280
|
+
textarea.style.opacity = "0";
|
|
281
|
+
textarea.style.pointerEvents = "none";
|
|
282
|
+
document.body.appendChild(textarea);
|
|
283
|
+
textarea.select();
|
|
284
|
+
textarea.setSelectionRange(0, textarea.value.length);
|
|
285
|
+
try {
|
|
286
|
+
const copied = document.execCommand("copy");
|
|
287
|
+
if (!copied) {
|
|
288
|
+
throw new Error("Browser denied clipboard write");
|
|
289
|
+
}
|
|
290
|
+
} finally {
|
|
291
|
+
textarea.remove();
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
function buildWatcherInfoText(watcher) {
|
|
295
|
+
if (!canCopyWatcherInfo(watcher)) {
|
|
296
|
+
return null;
|
|
297
|
+
}
|
|
298
|
+
const readyWatcher = watcher;
|
|
299
|
+
const target = readyWatcher.currentTarget;
|
|
300
|
+
const attached = target.attachedAt ? new Date(target.attachedAt).toISOString() : (/* @__PURE__ */ new Date()).toISOString();
|
|
301
|
+
const fields = [
|
|
302
|
+
["ID", readyWatcher.watcherId],
|
|
303
|
+
["Host", `${readyWatcher.watcherHost}:${readyWatcher.watcherPort}`],
|
|
304
|
+
["PID", String(readyWatcher.nativeHostPid)],
|
|
305
|
+
["Target", target.title || "(no title)"],
|
|
306
|
+
["URL", target.url || "(no url)"],
|
|
307
|
+
["Attached", attached]
|
|
308
|
+
];
|
|
309
|
+
return `Argus Watcher Info
|
|
310
|
+
${fields.map(([label, value]) => `${label}: ${value}`).join("\n")}`;
|
|
311
|
+
}
|
|
312
|
+
function buildAllWatchersInfoText(watchers) {
|
|
313
|
+
const watcherInfo = watchers.map((watcher) => buildWatcherInfoText(watcher)).filter((text) => Boolean(text));
|
|
314
|
+
if (watcherInfo.length === 0) {
|
|
315
|
+
return null;
|
|
316
|
+
}
|
|
317
|
+
return watcherInfo.join("\n\n");
|
|
318
|
+
}
|
|
319
|
+
function findWatcherByTabId(watchers, tabId) {
|
|
320
|
+
return watchers.find((watcher) => watcher.tabId === tabId) ?? null;
|
|
321
|
+
}
|
|
322
|
+
function canCopyWatcherInfo(watcher) {
|
|
323
|
+
return Boolean(watcher?.watcherId && watcher?.watcherHost && watcher?.watcherPort != null && watcher?.nativeHostPid && watcher?.currentTarget);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// src/popup/tab-feedback.ts
|
|
327
|
+
var feedback = /* @__PURE__ */ new Map();
|
|
328
|
+
var key = (tabId, action) => `${tabId}:${action}`;
|
|
329
|
+
var setTabFeedback = (tabId, action, label, durationMs, icon) => {
|
|
330
|
+
feedback.set(key(tabId, action), { label, icon, expiresAt: durationMs === Infinity ? Infinity : Date.now() + durationMs });
|
|
331
|
+
};
|
|
332
|
+
var clearTabFeedback = (tabId, action) => {
|
|
333
|
+
feedback.delete(key(tabId, action));
|
|
334
|
+
};
|
|
335
|
+
var getTabFeedback = (tabId, action) => {
|
|
336
|
+
const entry = feedback.get(key(tabId, action));
|
|
337
|
+
if (!entry) {
|
|
338
|
+
return null;
|
|
339
|
+
}
|
|
340
|
+
if (entry.expiresAt <= Date.now()) {
|
|
341
|
+
feedback.delete(key(tabId, action));
|
|
342
|
+
return null;
|
|
343
|
+
}
|
|
344
|
+
return entry;
|
|
345
|
+
};
|
|
346
|
+
var hasPendingTabFeedback = () => {
|
|
347
|
+
for (const [entryKey, entry] of feedback.entries()) {
|
|
348
|
+
if (entry.expiresAt <= Date.now()) {
|
|
349
|
+
feedback.delete(entryKey);
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
352
|
+
return true;
|
|
353
|
+
}
|
|
354
|
+
return false;
|
|
355
|
+
};
|
|
356
|
+
|
|
174
357
|
// src/popup/popup.ts
|
|
175
358
|
var COPY_ICON = `
|
|
176
359
|
<svg viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
@@ -198,17 +381,16 @@ var availableSection = document.getElementById("availableSection");
|
|
|
198
381
|
var availableContent = document.getElementById("availableContent");
|
|
199
382
|
var attachedCount = document.getElementById("attachedCount");
|
|
200
383
|
var errorBanner = document.getElementById("errorBanner");
|
|
201
|
-
var healthSummary = document.getElementById("healthSummary");
|
|
202
|
-
var healthNativeHost = document.getElementById("healthNativeHost");
|
|
203
|
-
var healthWatcherReady = document.getElementById("healthWatcherReady");
|
|
204
|
-
var healthWatcherId = document.getElementById("healthWatcherId");
|
|
205
|
-
var healthAttachedCount = document.getElementById("healthAttachedCount");
|
|
206
|
-
var healthSelectedTarget = document.getElementById("healthSelectedTarget");
|
|
207
|
-
var healthLastMessage = document.getElementById("healthLastMessage");
|
|
208
|
-
var healthPid = document.getElementById("healthPid");
|
|
209
384
|
var copyAllButton = document.getElementById("copyAllButton");
|
|
210
385
|
var detachAllButton = document.getElementById("detachAllButton");
|
|
211
386
|
var prevStateHash = "";
|
|
387
|
+
var latestTabs = [];
|
|
388
|
+
var latestActiveTabId;
|
|
389
|
+
async function renderFromLatestState() {
|
|
390
|
+
if (latestTabs.length > 0) {
|
|
391
|
+
renderTabs(latestTabs, latestActiveTabId);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
212
394
|
var currentError = null;
|
|
213
395
|
var latestCurrentWatcher = null;
|
|
214
396
|
var latestWatchers = [];
|
|
@@ -223,18 +405,15 @@ detachAllButton.addEventListener("click", () => {
|
|
|
223
405
|
document.querySelector(".health-summary-actions")?.addEventListener("click", (event) => {
|
|
224
406
|
event.stopPropagation();
|
|
225
407
|
});
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
chrome.runtime.sendMessage(message, resolve);
|
|
229
|
-
});
|
|
230
|
-
}
|
|
408
|
+
bindTabContainer(attachedContent);
|
|
409
|
+
bindTabContainer(availableContent);
|
|
231
410
|
function setEmptyState(icon, message) {
|
|
232
411
|
availableSection.classList.remove("hidden");
|
|
233
412
|
attachedSection.classList.add("hidden");
|
|
234
413
|
availableContent.innerHTML = `
|
|
235
414
|
<div class="empty-state">
|
|
236
|
-
<div class="icon">${
|
|
237
|
-
<div>${
|
|
415
|
+
<div class="icon">${escapeHtml(icon)}</div>
|
|
416
|
+
<div>${escapeHtml(message)}</div>
|
|
238
417
|
</div>
|
|
239
418
|
`;
|
|
240
419
|
}
|
|
@@ -248,61 +427,6 @@ function showError(message) {
|
|
|
248
427
|
errorBanner.textContent = message ?? "";
|
|
249
428
|
errorBanner.classList.toggle("hidden", !message);
|
|
250
429
|
}
|
|
251
|
-
function updateHealth(status, watcher) {
|
|
252
|
-
const target = watcher?.currentTarget ?? null;
|
|
253
|
-
const tabCount = status?.attachedTabs.length ?? 0;
|
|
254
|
-
const nativeHostConnected = watcher?.nativeHostConnected ?? status?.bridgeConnected ?? false;
|
|
255
|
-
const watcherReady = watcher?.watcherReady ?? false;
|
|
256
|
-
const targetState = watcher?.targetState ?? "not-selected";
|
|
257
|
-
healthSummary.textContent = buildHealthSummaryText({
|
|
258
|
-
nativeHostConnected,
|
|
259
|
-
watcherReady,
|
|
260
|
-
targetState,
|
|
261
|
-
watcherId: watcher?.watcherId ?? null,
|
|
262
|
-
tabCount
|
|
263
|
-
});
|
|
264
|
-
setHealthValueState(healthNativeHost, nativeHostConnected ? "Connected" : "Disconnected", nativeHostConnected ? "connected" : "disconnected");
|
|
265
|
-
setHealthValueState(healthWatcherReady, watcherReady ? "Ready" : "Not ready", watcherReady ? "connected" : "disconnected");
|
|
266
|
-
healthWatcherId.textContent = watcher?.watcherId ?? "-";
|
|
267
|
-
healthAttachedCount.textContent = String(tabCount);
|
|
268
|
-
setHealthValueState(healthSelectedTarget, formatTargetState(target, targetState), getTargetStateClass(targetState));
|
|
269
|
-
healthLastMessage.textContent = formatRelativeTimestamp(watcher?.lastMessageAt ?? null);
|
|
270
|
-
healthPid.textContent = watcher?.nativeHostPid ? String(watcher.nativeHostPid) : "-";
|
|
271
|
-
const hasWatchers = latestWatchers.length > 0;
|
|
272
|
-
copyAllButton.disabled = !hasWatchers;
|
|
273
|
-
detachAllButton.disabled = !hasWatchers;
|
|
274
|
-
}
|
|
275
|
-
function buildHealthSummaryText(input) {
|
|
276
|
-
const parts = [];
|
|
277
|
-
if (input.watcherId) parts.push(input.watcherId);
|
|
278
|
-
parts.push(input.nativeHostConnected ? "Host connected" : "Host disconnected");
|
|
279
|
-
parts.push(input.watcherReady ? "Watcher ready" : "Watcher not ready");
|
|
280
|
-
if (input.targetState === "rebinding") parts.push("Target rebinding");
|
|
281
|
-
if (input.tabCount > 0) parts.push(`${input.tabCount} tab${input.tabCount === 1 ? "" : "s"}`);
|
|
282
|
-
return parts.join(" \xB7 ");
|
|
283
|
-
}
|
|
284
|
-
function setHealthValueState(element, text, stateClass) {
|
|
285
|
-
element.textContent = text;
|
|
286
|
-
element.classList.toggle("connected", stateClass === "connected");
|
|
287
|
-
element.classList.toggle("disconnected", stateClass === "disconnected");
|
|
288
|
-
element.classList.toggle("warning", stateClass === "warning");
|
|
289
|
-
}
|
|
290
|
-
function formatTargetState(target, state) {
|
|
291
|
-
if (!target || state === "not-selected") {
|
|
292
|
-
return "-";
|
|
293
|
-
}
|
|
294
|
-
const label = target.type === "page" ? "Page" : "Iframe";
|
|
295
|
-
return state === "ready" ? `${label} ready` : `${label} rebinding`;
|
|
296
|
-
}
|
|
297
|
-
function getTargetStateClass(state) {
|
|
298
|
-
if (state === "ready") {
|
|
299
|
-
return "connected";
|
|
300
|
-
}
|
|
301
|
-
if (state === "rebinding") {
|
|
302
|
-
return "warning";
|
|
303
|
-
}
|
|
304
|
-
return null;
|
|
305
|
-
}
|
|
306
430
|
function renderTabs(tabs, currentTabId) {
|
|
307
431
|
if (tabs.length === 0) {
|
|
308
432
|
setEmptyState("\u{1F50D}", "No tabs available");
|
|
@@ -321,7 +445,7 @@ function renderTabs(tabs, currentTabId) {
|
|
|
321
445
|
renderTabGroup(availableSection, availableContent, availableTabs, false);
|
|
322
446
|
}
|
|
323
447
|
function renderTabItem(tab, showTargets) {
|
|
324
|
-
const favicon = tab.faviconUrl ? `<img class="tab-favicon" src="${
|
|
448
|
+
const favicon = tab.faviconUrl ? `<img class="tab-favicon" src="${escapeHtml(tab.faviconUrl)}" alt="">` : `<div class="tab-favicon" style="background: #e0e0e0"></div>`;
|
|
325
449
|
const watcherSuffix = tab.attached && tab.watcher?.watcherId ? ` (${tab.watcher.watcherId})` : "";
|
|
326
450
|
const actions = tab.attached ? renderAttachedTabActions(tab.tabId) : renderAttachButton(tab.tabId);
|
|
327
451
|
const fullTitle = (tab.title || "Untitled") + watcherSuffix;
|
|
@@ -329,8 +453,8 @@ function renderTabItem(tab, showTargets) {
|
|
|
329
453
|
<div class="tab-item ${tab.attached ? "attached" : ""}" data-tab-id="${tab.tabId}">
|
|
330
454
|
${favicon}
|
|
331
455
|
<div class="tab-info">
|
|
332
|
-
<div class="tab-title" title="${
|
|
333
|
-
<div class="tab-url" title="${
|
|
456
|
+
<div class="tab-title" title="${escapeHtml(fullTitle)}">${escapeHtml(fullTitle)}</div>
|
|
457
|
+
<div class="tab-url" title="${escapeHtml(tab.url)}">${escapeHtml(tab.url)}</div>
|
|
334
458
|
</div>
|
|
335
459
|
${actions}
|
|
336
460
|
</div>
|
|
@@ -345,20 +469,27 @@ function renderTabGroup(section, content, tabs, showTargets) {
|
|
|
345
469
|
}
|
|
346
470
|
section.classList.remove("hidden");
|
|
347
471
|
content.innerHTML = `<div class="tab-list">${tabs.map((tab) => renderTabItem(tab, showTargets)).join("")}</div>`;
|
|
348
|
-
bindTabInteractions(content);
|
|
349
472
|
}
|
|
350
|
-
function
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
473
|
+
function bindTabContainer(container) {
|
|
474
|
+
container.addEventListener("click", (event) => {
|
|
475
|
+
const actionButton = event.target.closest(".tab-action, [data-action]");
|
|
476
|
+
if (actionButton?.classList.contains("tab-action")) {
|
|
477
|
+
void handleTabAction(actionButton);
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
if (actionButton?.dataset.action === "select-target") {
|
|
481
|
+
void handleTargetSelection(actionButton);
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
if (actionButton?.dataset.action === "hide-target" || actionButton?.dataset.action === "show-target") {
|
|
485
|
+
event.stopPropagation();
|
|
486
|
+
void handleTargetVisibility(actionButton);
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
const tabItem = event.target.closest(".tab-item");
|
|
490
|
+
if (tabItem) {
|
|
491
|
+
void handleTabItemClick(tabItem);
|
|
492
|
+
}
|
|
362
493
|
});
|
|
363
494
|
}
|
|
364
495
|
function renderAttachedTabActions(tabId) {
|
|
@@ -370,167 +501,151 @@ function renderAttachedTabActions(tabId) {
|
|
|
370
501
|
`;
|
|
371
502
|
}
|
|
372
503
|
function renderAttachButton(tabId) {
|
|
373
|
-
|
|
504
|
+
const pending = getTabFeedback(tabId, "attach");
|
|
505
|
+
const disabled = pending ? " disabled" : "";
|
|
506
|
+
return `<button class="tab-action attach" data-tab-id="${tabId}" data-action="attach" type="button"${disabled}>${escapeHtml(pending?.label ?? "Attach")}</button>`;
|
|
374
507
|
}
|
|
375
508
|
function renderIconActionButton(tabId, action, variant, label, icon) {
|
|
509
|
+
const pending = getTabFeedback(tabId, action);
|
|
376
510
|
return `
|
|
377
511
|
<button
|
|
378
512
|
class="tab-action icon-only ${variant}"
|
|
379
513
|
data-tab-id="${tabId}"
|
|
380
514
|
data-action="${action}"
|
|
381
515
|
type="button"
|
|
382
|
-
title="${label}"
|
|
383
|
-
aria-label="${label}"
|
|
516
|
+
title="${escapeHtml(pending?.label ?? label)}"
|
|
517
|
+
aria-label="${escapeHtml(pending?.label ?? label)}"
|
|
518
|
+
${pending ? "disabled" : ""}
|
|
384
519
|
>
|
|
385
|
-
<span class="tab-action-icon" aria-hidden="true">${icon}</span>
|
|
520
|
+
<span class="tab-action-icon" aria-hidden="true">${pending?.icon ?? icon}</span>
|
|
386
521
|
</button>
|
|
387
522
|
`;
|
|
388
523
|
}
|
|
389
|
-
async function handleTabItemClick(
|
|
390
|
-
const target = event.target;
|
|
391
|
-
if (target.closest(".tab-action")) {
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
const tabItem = event.currentTarget;
|
|
524
|
+
async function handleTabItemClick(tabItem) {
|
|
395
525
|
const tabId = getTabId(tabItem);
|
|
396
526
|
const action = getTabItemAction(tabItem);
|
|
397
|
-
|
|
398
|
-
|
|
527
|
+
setTabFeedback(tabId, "attach", action === "attach" ? "Attaching..." : "Focusing...", Infinity);
|
|
528
|
+
await renderFromLatestState();
|
|
399
529
|
try {
|
|
400
|
-
await
|
|
530
|
+
await runTabAction(action, tabId);
|
|
531
|
+
clearTabFeedback(tabId, "attach");
|
|
401
532
|
if (action === "attach") {
|
|
402
533
|
await refreshTabs(true);
|
|
534
|
+
} else {
|
|
535
|
+
await renderFromLatestState();
|
|
403
536
|
}
|
|
404
537
|
} catch (error) {
|
|
538
|
+
clearTabFeedback(tabId, "attach");
|
|
405
539
|
showError(error instanceof Error ? error.message : `${capitalize(action)} failed`);
|
|
406
|
-
|
|
407
|
-
tabItem.style.pointerEvents = "auto";
|
|
540
|
+
await renderFromLatestState();
|
|
408
541
|
}
|
|
409
542
|
}
|
|
410
543
|
function getTabItemAction(tabItem) {
|
|
411
544
|
return tabItem.classList.contains("attached") ? "focusTab" : "attach";
|
|
412
545
|
}
|
|
413
|
-
async function handleTabAction(
|
|
414
|
-
const button = event.target.closest(".tab-action");
|
|
415
|
-
if (!button) {
|
|
416
|
-
return;
|
|
417
|
-
}
|
|
546
|
+
async function handleTabAction(button) {
|
|
418
547
|
const tabId = getTabId(button);
|
|
419
548
|
const action = button.dataset.action;
|
|
420
549
|
if (action === "copy-info") {
|
|
421
550
|
try {
|
|
422
|
-
await copyWatcherInfo(tabId
|
|
551
|
+
await copyWatcherInfo(tabId);
|
|
423
552
|
} catch (error) {
|
|
424
553
|
showError(error instanceof Error ? error.message : "Copy failed");
|
|
425
554
|
}
|
|
426
555
|
return;
|
|
427
556
|
}
|
|
428
|
-
|
|
557
|
+
setTabFeedback(tabId, action, action === "attach" ? "Attaching..." : "Detaching...", Infinity);
|
|
558
|
+
await renderFromLatestState();
|
|
429
559
|
try {
|
|
430
|
-
await
|
|
560
|
+
await runTabAction(action, tabId);
|
|
561
|
+
clearTabFeedback(tabId, action);
|
|
431
562
|
await refreshTabs(true);
|
|
432
563
|
} catch (error) {
|
|
564
|
+
clearTabFeedback(tabId, action);
|
|
433
565
|
showError(error instanceof Error ? error.message : `${capitalize(action)} failed`);
|
|
434
|
-
|
|
566
|
+
await renderFromLatestState();
|
|
435
567
|
}
|
|
436
568
|
}
|
|
437
|
-
async function handleTargetSelection(
|
|
438
|
-
const button = event.currentTarget;
|
|
569
|
+
async function handleTargetSelection(button) {
|
|
439
570
|
const tabId = getTabId(button);
|
|
440
571
|
const frameId = button.dataset.frameId || null;
|
|
441
572
|
button.disabled = true;
|
|
442
573
|
try {
|
|
443
|
-
await
|
|
574
|
+
await runTargetAction("selectTarget", tabId, frameId);
|
|
444
575
|
await refreshTabs(true);
|
|
445
576
|
} catch (error) {
|
|
446
577
|
showError(error instanceof Error ? error.message : "Target selection failed");
|
|
447
578
|
button.disabled = false;
|
|
448
579
|
}
|
|
449
580
|
}
|
|
450
|
-
async function handleTargetVisibility(
|
|
451
|
-
event.stopPropagation();
|
|
452
|
-
const button = event.currentTarget;
|
|
581
|
+
async function handleTargetVisibility(button) {
|
|
453
582
|
const tabId = getTabId(button);
|
|
454
583
|
const frameId = button.dataset.frameId || null;
|
|
455
584
|
const action = button.dataset.action === "show-target" ? "showTarget" : "hideTarget";
|
|
456
585
|
button.disabled = true;
|
|
457
586
|
try {
|
|
458
|
-
await
|
|
587
|
+
await runTargetAction(action, tabId, frameId);
|
|
459
588
|
await refreshTabs(true);
|
|
460
589
|
} catch (error) {
|
|
461
590
|
showError(error instanceof Error ? error.message : action === "hideTarget" ? "Target hide failed" : "Target restore failed");
|
|
462
591
|
button.disabled = false;
|
|
463
592
|
}
|
|
464
593
|
}
|
|
465
|
-
async function
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
594
|
+
async function runTabAction(action, tabId) {
|
|
595
|
+
await runPopupMessage({ action, tabId });
|
|
596
|
+
showError(null);
|
|
597
|
+
}
|
|
598
|
+
async function runTargetAction(action, tabId, frameId) {
|
|
599
|
+
await runPopupMessage({ action, tabId, frameId });
|
|
470
600
|
showError(null);
|
|
471
601
|
}
|
|
472
602
|
async function refreshTabs(forceRender = false) {
|
|
473
603
|
try {
|
|
474
604
|
const [statusResponse, tabsResponse, activeTab] = await Promise.all([
|
|
475
|
-
|
|
476
|
-
|
|
605
|
+
sendPopupMessage({ action: "getStatus" }),
|
|
606
|
+
sendPopupMessage({ action: "getTargets" }),
|
|
477
607
|
getCurrentTab()
|
|
478
608
|
]);
|
|
479
609
|
if (!statusResponse.success) {
|
|
480
|
-
throw new Error(statusResponse.error
|
|
610
|
+
throw new Error(statusResponse.error);
|
|
481
611
|
}
|
|
482
612
|
const status = statusResponse.status;
|
|
483
|
-
|
|
484
|
-
|
|
613
|
+
const tabs = tabsResponse.success ? tabsResponse.tabs : null;
|
|
614
|
+
const tabsError = tabsResponse.success ? null : tabsResponse.error;
|
|
615
|
+
latestWatchers = status.watchers;
|
|
616
|
+
latestCurrentWatcher = selectCurrentWatcher(status, tabs ?? [], activeTab?.id);
|
|
485
617
|
const stateHash = JSON.stringify({
|
|
486
618
|
status,
|
|
487
|
-
tabs
|
|
619
|
+
tabs,
|
|
488
620
|
currentTabId: activeTab?.id,
|
|
489
|
-
error: currentError ??
|
|
621
|
+
error: currentError ?? tabsError
|
|
490
622
|
});
|
|
491
|
-
if (!forceRender && stateHash === prevStateHash) {
|
|
623
|
+
if (!forceRender && stateHash === prevStateHash && !hasPendingTabFeedback()) {
|
|
492
624
|
return;
|
|
493
625
|
}
|
|
494
626
|
prevStateHash = stateHash;
|
|
495
|
-
updateStatus(status
|
|
496
|
-
updateHealth(status, latestCurrentWatcher);
|
|
497
|
-
if (
|
|
498
|
-
|
|
627
|
+
updateStatus(status.bridgeConnected, status.attachedTabs.length);
|
|
628
|
+
updateHealth(status, latestCurrentWatcher, { copyAll: copyAllButton, detachAll: detachAllButton }, latestWatchers.length > 0);
|
|
629
|
+
if (tabs) {
|
|
630
|
+
latestTabs = tabs;
|
|
631
|
+
latestActiveTabId = activeTab?.id;
|
|
632
|
+
renderTabs(tabs, activeTab?.id);
|
|
499
633
|
showError(currentError);
|
|
500
634
|
return;
|
|
501
635
|
}
|
|
502
|
-
showError(
|
|
503
|
-
setEmptyState("\u26A0\uFE0F",
|
|
636
|
+
showError(tabsError ?? "Failed to load tabs");
|
|
637
|
+
setEmptyState("\u26A0\uFE0F", tabsError ?? "Failed to load tabs");
|
|
504
638
|
} catch (error) {
|
|
505
639
|
const message = error instanceof Error ? error.message : "Failed to refresh popup";
|
|
506
640
|
showError(message);
|
|
507
641
|
updateStatus(false, 0);
|
|
508
642
|
latestWatchers = [];
|
|
509
643
|
latestCurrentWatcher = null;
|
|
510
|
-
updateHealth(void 0, null);
|
|
644
|
+
updateHealth(void 0, null, { copyAll: copyAllButton, detachAll: detachAllButton }, false);
|
|
511
645
|
setEmptyState("\u26A0\uFE0F", message);
|
|
512
646
|
}
|
|
513
647
|
}
|
|
514
|
-
function
|
|
515
|
-
if (!timestamp) {
|
|
516
|
-
return "-";
|
|
517
|
-
}
|
|
518
|
-
const elapsedMs = Math.max(0, Date.now() - timestamp);
|
|
519
|
-
if (elapsedMs < 1e3) {
|
|
520
|
-
return "Just now";
|
|
521
|
-
}
|
|
522
|
-
const elapsedSeconds = Math.floor(elapsedMs / 1e3);
|
|
523
|
-
if (elapsedSeconds < 60) {
|
|
524
|
-
return `${elapsedSeconds}s ago`;
|
|
525
|
-
}
|
|
526
|
-
const elapsedMinutes = Math.floor(elapsedSeconds / 60);
|
|
527
|
-
if (elapsedMinutes < 60) {
|
|
528
|
-
return `${elapsedMinutes}m ago`;
|
|
529
|
-
}
|
|
530
|
-
const elapsedHours = Math.floor(elapsedMinutes / 60);
|
|
531
|
-
return `${elapsedHours}h ago`;
|
|
532
|
-
}
|
|
533
|
-
async function copyWatcherInfo(tabId, button) {
|
|
648
|
+
async function copyWatcherInfo(tabId) {
|
|
534
649
|
const watcher = findWatcherByTabId(latestWatchers, tabId);
|
|
535
650
|
const text = buildWatcherInfoText(watcher);
|
|
536
651
|
if (!text) {
|
|
@@ -538,7 +653,8 @@ async function copyWatcherInfo(tabId, button) {
|
|
|
538
653
|
}
|
|
539
654
|
await copyTextToClipboard(text);
|
|
540
655
|
showError(null);
|
|
541
|
-
|
|
656
|
+
setTabFeedback(tabId, "copy-info", "Copied!", 1500, CHECK_ICON);
|
|
657
|
+
await renderFromLatestState();
|
|
542
658
|
}
|
|
543
659
|
async function copyAllWatchersInfo() {
|
|
544
660
|
const text = buildAllWatchersInfoText(latestWatchers);
|
|
@@ -549,30 +665,6 @@ async function copyAllWatchersInfo() {
|
|
|
549
665
|
showError(null);
|
|
550
666
|
restoreButtonFeedback(copyAllButton, "Copied!");
|
|
551
667
|
}
|
|
552
|
-
async function copyTextToClipboard(text) {
|
|
553
|
-
try {
|
|
554
|
-
await navigator.clipboard.writeText(text);
|
|
555
|
-
return;
|
|
556
|
-
} catch {
|
|
557
|
-
}
|
|
558
|
-
const textarea = document.createElement("textarea");
|
|
559
|
-
textarea.value = text;
|
|
560
|
-
textarea.setAttribute("readonly", "true");
|
|
561
|
-
textarea.style.position = "fixed";
|
|
562
|
-
textarea.style.opacity = "0";
|
|
563
|
-
textarea.style.pointerEvents = "none";
|
|
564
|
-
document.body.appendChild(textarea);
|
|
565
|
-
textarea.select();
|
|
566
|
-
textarea.setSelectionRange(0, textarea.value.length);
|
|
567
|
-
try {
|
|
568
|
-
const copied = document.execCommand("copy");
|
|
569
|
-
if (!copied) {
|
|
570
|
-
throw new Error("Browser denied clipboard write");
|
|
571
|
-
}
|
|
572
|
-
} finally {
|
|
573
|
-
textarea.remove();
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
668
|
async function detachAllWatchers() {
|
|
577
669
|
if (latestWatchers.length === 0) {
|
|
578
670
|
return;
|
|
@@ -592,24 +684,13 @@ async function detachWatchers(tabIds) {
|
|
|
592
684
|
const failures = [];
|
|
593
685
|
for (const tabId of tabIds) {
|
|
594
686
|
try {
|
|
595
|
-
await
|
|
687
|
+
await runTabAction("detach", tabId);
|
|
596
688
|
} catch {
|
|
597
689
|
failures.push(tabId);
|
|
598
690
|
}
|
|
599
691
|
}
|
|
600
692
|
return failures;
|
|
601
693
|
}
|
|
602
|
-
function setBusyButtonState(button, action) {
|
|
603
|
-
const previousMarkup = button.innerHTML;
|
|
604
|
-
const restoreFeedback = setButtonFeedback(button, action === "attach" ? "Attaching..." : "Detaching...");
|
|
605
|
-
if (action === "attach") {
|
|
606
|
-
button.textContent = "Attaching...";
|
|
607
|
-
}
|
|
608
|
-
return () => {
|
|
609
|
-
button.innerHTML = previousMarkup;
|
|
610
|
-
restoreFeedback();
|
|
611
|
-
};
|
|
612
|
-
}
|
|
613
694
|
function restoreButtonFeedback(button, label, timeoutMs = 1500, iconMarkup) {
|
|
614
695
|
const restore = setButtonFeedback(button, label, iconMarkup);
|
|
615
696
|
setTimeout(restore, timeoutMs);
|
|
@@ -635,31 +716,6 @@ function setButtonFeedback(button, label, iconMarkup) {
|
|
|
635
716
|
setButtonIconMarkup(button, previousIcon);
|
|
636
717
|
};
|
|
637
718
|
}
|
|
638
|
-
function buildWatcherInfoText(watcher) {
|
|
639
|
-
if (!canCopyWatcherInfo(watcher)) {
|
|
640
|
-
return null;
|
|
641
|
-
}
|
|
642
|
-
const readyWatcher = watcher;
|
|
643
|
-
const target = readyWatcher.currentTarget;
|
|
644
|
-
const attached = target.attachedAt ? new Date(target.attachedAt).toISOString() : (/* @__PURE__ */ new Date()).toISOString();
|
|
645
|
-
const fields = [
|
|
646
|
-
["ID", readyWatcher.watcherId],
|
|
647
|
-
["Host", `${readyWatcher.watcherHost}:${readyWatcher.watcherPort}`],
|
|
648
|
-
["PID", String(readyWatcher.nativeHostPid)],
|
|
649
|
-
["Target", target.title || "(no title)"],
|
|
650
|
-
["URL", target.url || "(no url)"],
|
|
651
|
-
["Attached", attached]
|
|
652
|
-
];
|
|
653
|
-
return `Argus Watcher Info
|
|
654
|
-
${fields.map(([label, value]) => `${label}: ${value}`).join("\n")}`;
|
|
655
|
-
}
|
|
656
|
-
function buildAllWatchersInfoText(watchers) {
|
|
657
|
-
const watcherInfo = watchers.map((watcher) => buildWatcherInfoText(watcher)).filter((text) => Boolean(text));
|
|
658
|
-
if (watcherInfo.length === 0) {
|
|
659
|
-
return null;
|
|
660
|
-
}
|
|
661
|
-
return watcherInfo.join("\n\n");
|
|
662
|
-
}
|
|
663
719
|
function buildDetachAllError(failureCount) {
|
|
664
720
|
return failureCount === 1 ? "Failed to detach 1 watcher" : `Failed to detach ${failureCount} watchers`;
|
|
665
721
|
}
|
|
@@ -687,12 +743,6 @@ function selectCurrentWatcher(status, tabs, activeTabId) {
|
|
|
687
743
|
}
|
|
688
744
|
return status.watchers[0] ?? null;
|
|
689
745
|
}
|
|
690
|
-
function canCopyWatcherInfo(watcher) {
|
|
691
|
-
return Boolean(watcher?.watcherId && watcher?.watcherHost && watcher?.watcherPort != null && watcher?.nativeHostPid && watcher?.currentTarget);
|
|
692
|
-
}
|
|
693
|
-
function findWatcherByTabId(watchers, tabId) {
|
|
694
|
-
return watchers.find((watcher) => watcher.tabId === tabId) ?? null;
|
|
695
|
-
}
|
|
696
746
|
function getTabId(element) {
|
|
697
747
|
return parseInt(element.dataset.tabId ?? "0", 10);
|
|
698
748
|
}
|
|
@@ -714,11 +764,6 @@ function setButtonIconMarkup(button, iconMarkup) {
|
|
|
714
764
|
iconNode.innerHTML = iconMarkup;
|
|
715
765
|
}
|
|
716
766
|
}
|
|
717
|
-
function escapeHtml2(text) {
|
|
718
|
-
const div = document.createElement("div");
|
|
719
|
-
div.textContent = text;
|
|
720
|
-
return div.innerHTML;
|
|
721
|
-
}
|
|
722
767
|
async function getCurrentTab() {
|
|
723
768
|
const tabs = await chrome.tabs.query({ active: true, currentWindow: true });
|
|
724
769
|
return tabs[0];
|