@vforsh/argus-watcher 0.1.11 → 0.1.13
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/cdp/mouse.d.ts +19 -3
- package/dist/cdp/mouse.d.ts.map +1 -1
- package/dist/cdp/mouse.js +57 -9
- package/dist/cdp/mouse.js.map +1 -1
- package/dist/cdp/pageIndicator.d.ts +5 -0
- package/dist/cdp/pageIndicator.d.ts.map +1 -1
- package/dist/cdp/pageIndicator.js +22 -254
- package/dist/cdp/pageIndicator.js.map +1 -1
- package/dist/cdp/pageIndicatorScript.d.ts +20 -0
- package/dist/cdp/pageIndicatorScript.d.ts.map +1 -0
- package/dist/cdp/pageIndicatorScript.js +405 -0
- package/dist/cdp/pageIndicatorScript.js.map +1 -0
- package/dist/cdp/recording.d.ts +15 -0
- package/dist/cdp/recording.d.ts.map +1 -0
- package/dist/cdp/recording.js +389 -0
- package/dist/cdp/recording.js.map +1 -0
- package/dist/cdp/screenshot.d.ts.map +1 -1
- package/dist/cdp/screenshot.js +2 -133
- package/dist/cdp/screenshot.js.map +1 -1
- package/dist/cdp/visualCapture.d.ts +38 -0
- package/dist/cdp/visualCapture.d.ts.map +1 -0
- package/dist/cdp/visualCapture.js +156 -0
- package/dist/cdp/visualCapture.js.map +1 -0
- package/dist/events.d.ts +1 -1
- package/dist/events.d.ts.map +1 -1
- package/dist/http/routes/authCookies.d.ts +5 -10
- package/dist/http/routes/authCookies.d.ts.map +1 -1
- package/dist/http/routes/authCookies.js +17 -30
- package/dist/http/routes/authCookies.js.map +1 -1
- package/dist/http/routes/defineDomTargetRoute.d.ts +14 -5
- package/dist/http/routes/defineDomTargetRoute.d.ts.map +1 -1
- package/dist/http/routes/defineDomTargetRoute.js +27 -33
- package/dist/http/routes/defineDomTargetRoute.js.map +1 -1
- package/dist/http/routes/defineRoute.d.ts +9 -0
- package/dist/http/routes/defineRoute.d.ts.map +1 -1
- package/dist/http/routes/defineRoute.js +9 -9
- package/dist/http/routes/defineRoute.js.map +1 -1
- package/dist/http/routes/domSelectorRoute.d.ts +4 -11
- package/dist/http/routes/domSelectorRoute.d.ts.map +1 -1
- package/dist/http/routes/domSelectorRoute.js +9 -17
- package/dist/http/routes/domSelectorRoute.js.map +1 -1
- package/dist/http/routes/getAuthCookies.d.ts +1 -2
- package/dist/http/routes/getAuthCookies.d.ts.map +1 -1
- package/dist/http/routes/getAuthCookies.js +14 -14
- package/dist/http/routes/getAuthCookies.js.map +1 -1
- package/dist/http/routes/getAuthState.d.ts +1 -2
- package/dist/http/routes/getAuthState.d.ts.map +1 -1
- package/dist/http/routes/getAuthState.js +13 -13
- package/dist/http/routes/getAuthState.js.map +1 -1
- package/dist/http/routes/getDialog.d.ts +1 -2
- package/dist/http/routes/getDialog.d.ts.map +1 -1
- package/dist/http/routes/getDialog.js +7 -10
- package/dist/http/routes/getDialog.js.map +1 -1
- package/dist/http/routes/getEmulation.d.ts +1 -2
- package/dist/http/routes/getEmulation.d.ts.map +1 -1
- package/dist/http/routes/getEmulation.js +7 -7
- package/dist/http/routes/getEmulation.js.map +1 -1
- package/dist/http/routes/getExtensionDiagnostics.d.ts +2 -0
- package/dist/http/routes/getExtensionDiagnostics.d.ts.map +1 -0
- package/dist/http/routes/getExtensionDiagnostics.js +16 -0
- package/dist/http/routes/getExtensionDiagnostics.js.map +1 -0
- package/dist/http/routes/getExtensionTabs.d.ts +1 -2
- package/dist/http/routes/getExtensionTabs.d.ts.map +1 -1
- package/dist/http/routes/getExtensionTabs.js +18 -16
- package/dist/http/routes/getExtensionTabs.js.map +1 -1
- package/dist/http/routes/getLogs.d.ts +1 -2
- package/dist/http/routes/getLogs.d.ts.map +1 -1
- package/dist/http/routes/getLogs.js +31 -26
- package/dist/http/routes/getLogs.js.map +1 -1
- package/dist/http/routes/getNet.d.ts +1 -2
- package/dist/http/routes/getNet.d.ts.map +1 -1
- package/dist/http/routes/getNet.js +19 -21
- package/dist/http/routes/getNet.js.map +1 -1
- package/dist/http/routes/getNetRequest.d.ts +1 -2
- package/dist/http/routes/getNetRequest.d.ts.map +1 -1
- package/dist/http/routes/getNetRequest.js +22 -20
- package/dist/http/routes/getNetRequest.js.map +1 -1
- package/dist/http/routes/getNetRequestBody.d.ts +1 -2
- package/dist/http/routes/getNetRequestBody.d.ts.map +1 -1
- package/dist/http/routes/getNetRequestBody.js +53 -51
- package/dist/http/routes/getNetRequestBody.js.map +1 -1
- package/dist/http/routes/getNetRequests.d.ts +1 -2
- package/dist/http/routes/getNetRequests.d.ts.map +1 -1
- package/dist/http/routes/getNetRequests.js +19 -21
- package/dist/http/routes/getNetRequests.js.map +1 -1
- package/dist/http/routes/getNetSse.d.ts +1 -2
- package/dist/http/routes/getNetSse.d.ts.map +1 -1
- package/dist/http/routes/getNetSse.js +19 -21
- package/dist/http/routes/getNetSse.js.map +1 -1
- package/dist/http/routes/getNetTail.d.ts +1 -2
- package/dist/http/routes/getNetTail.d.ts.map +1 -1
- package/dist/http/routes/getNetTail.js +21 -30
- package/dist/http/routes/getNetTail.js.map +1 -1
- package/dist/http/routes/getNetWebSocketConnection.d.ts +1 -2
- package/dist/http/routes/getNetWebSocketConnection.d.ts.map +1 -1
- package/dist/http/routes/getNetWebSocketConnection.js +22 -17
- package/dist/http/routes/getNetWebSocketConnection.js.map +1 -1
- package/dist/http/routes/getNetWebSockets.d.ts +1 -2
- package/dist/http/routes/getNetWebSockets.d.ts.map +1 -1
- package/dist/http/routes/getNetWebSockets.js +19 -21
- package/dist/http/routes/getNetWebSockets.js.map +1 -1
- package/dist/http/routes/getStatus.d.ts +1 -2
- package/dist/http/routes/getStatus.d.ts.map +1 -1
- package/dist/http/routes/getStatus.js +6 -4
- package/dist/http/routes/getStatus.js.map +1 -1
- package/dist/http/routes/getTail.d.ts +1 -2
- package/dist/http/routes/getTail.d.ts.map +1 -1
- package/dist/http/routes/getTail.js +31 -26
- package/dist/http/routes/getTail.js.map +1 -1
- package/dist/http/routes/getTargets.d.ts +1 -2
- package/dist/http/routes/getTargets.d.ts.map +1 -1
- package/dist/http/routes/getTargets.js +14 -13
- package/dist/http/routes/getTargets.js.map +1 -1
- package/dist/http/routes/getThrottle.d.ts +1 -2
- package/dist/http/routes/getThrottle.d.ts.map +1 -1
- package/dist/http/routes/getThrottle.js +7 -7
- package/dist/http/routes/getThrottle.js.map +1 -1
- package/dist/http/routes/index.d.ts +5 -1
- package/dist/http/routes/index.d.ts.map +1 -1
- package/dist/http/routes/index.js +121 -114
- package/dist/http/routes/index.js.map +1 -1
- package/dist/http/routes/netFilters.d.ts +10 -0
- package/dist/http/routes/netFilters.d.ts.map +1 -1
- package/dist/http/routes/netFilters.js +23 -1
- package/dist/http/routes/netFilters.js.map +1 -1
- package/dist/http/routes/netMock.d.ts +3 -0
- package/dist/http/routes/netMock.d.ts.map +1 -0
- package/dist/http/routes/netMock.js +141 -0
- package/dist/http/routes/netMock.js.map +1 -0
- package/dist/http/routes/postAttach.d.ts +1 -2
- package/dist/http/routes/postAttach.d.ts.map +1 -1
- package/dist/http/routes/postAttach.js +23 -22
- package/dist/http/routes/postAttach.js.map +1 -1
- package/dist/http/routes/postAuthStateLoad.d.ts +1 -2
- package/dist/http/routes/postAuthStateLoad.d.ts.map +1 -1
- package/dist/http/routes/postAuthStateLoad.js +29 -34
- package/dist/http/routes/postAuthStateLoad.js.map +1 -1
- package/dist/http/routes/postCodeEdit.d.ts +1 -2
- package/dist/http/routes/postCodeEdit.d.ts.map +1 -1
- package/dist/http/routes/postCodeEdit.js +20 -25
- package/dist/http/routes/postCodeEdit.js.map +1 -1
- package/dist/http/routes/postCodeGrep.d.ts +1 -2
- package/dist/http/routes/postCodeGrep.d.ts.map +1 -1
- package/dist/http/routes/postCodeGrep.js +20 -25
- package/dist/http/routes/postCodeGrep.js.map +1 -1
- package/dist/http/routes/postCodeList.d.ts +1 -2
- package/dist/http/routes/postCodeList.d.ts.map +1 -1
- package/dist/http/routes/postCodeList.js +14 -19
- package/dist/http/routes/postCodeList.js.map +1 -1
- package/dist/http/routes/postCodeRead.d.ts +1 -2
- package/dist/http/routes/postCodeRead.d.ts.map +1 -1
- package/dist/http/routes/postCodeRead.js +24 -29
- package/dist/http/routes/postCodeRead.js.map +1 -1
- package/dist/http/routes/postDetach.d.ts +1 -2
- package/dist/http/routes/postDetach.d.ts.map +1 -1
- package/dist/http/routes/postDetach.js +23 -22
- package/dist/http/routes/postDetach.js.map +1 -1
- package/dist/http/routes/postDialog.d.ts +1 -2
- package/dist/http/routes/postDialog.d.ts.map +1 -1
- package/dist/http/routes/postDialog.js +30 -29
- package/dist/http/routes/postDialog.js.map +1 -1
- package/dist/http/routes/postDomAdd.d.ts +1 -2
- package/dist/http/routes/postDomAdd.d.ts.map +1 -1
- package/dist/http/routes/postDomAdd.js +44 -48
- package/dist/http/routes/postDomAdd.js.map +1 -1
- package/dist/http/routes/postDomClick.d.ts +0 -1
- package/dist/http/routes/postDomClick.d.ts.map +1 -1
- package/dist/http/routes/postDomClick.js +12 -21
- package/dist/http/routes/postDomClick.js.map +1 -1
- package/dist/http/routes/postDomDrag.d.ts +2 -0
- package/dist/http/routes/postDomDrag.d.ts.map +1 -0
- package/dist/http/routes/postDomDrag.js +54 -0
- package/dist/http/routes/postDomDrag.js.map +1 -0
- package/dist/http/routes/postDomFill.d.ts +1 -2
- package/dist/http/routes/postDomFill.d.ts.map +1 -1
- package/dist/http/routes/postDomFill.js +17 -49
- package/dist/http/routes/postDomFill.js.map +1 -1
- package/dist/http/routes/postDomInfo.d.ts +1 -2
- package/dist/http/routes/postDomInfo.d.ts.map +1 -1
- package/dist/http/routes/postDomInfo.js +14 -20
- package/dist/http/routes/postDomInfo.js.map +1 -1
- package/dist/http/routes/postDomKeydown.d.ts +1 -2
- package/dist/http/routes/postDomKeydown.d.ts.map +1 -1
- package/dist/http/routes/postDomKeydown.js +26 -30
- package/dist/http/routes/postDomKeydown.js.map +1 -1
- package/dist/http/routes/postDomModify.d.ts +1 -2
- package/dist/http/routes/postDomModify.d.ts.map +1 -1
- package/dist/http/routes/postDomModify.js +30 -41
- package/dist/http/routes/postDomModify.js.map +1 -1
- package/dist/http/routes/postDomRemove.d.ts +1 -2
- package/dist/http/routes/postDomRemove.d.ts.map +1 -1
- package/dist/http/routes/postDomRemove.js +13 -18
- package/dist/http/routes/postDomRemove.js.map +1 -1
- package/dist/http/routes/postDomScroll.d.ts +1 -2
- package/dist/http/routes/postDomScroll.d.ts.map +1 -1
- package/dist/http/routes/postDomScroll.js +37 -42
- package/dist/http/routes/postDomScroll.js.map +1 -1
- package/dist/http/routes/postDomScrollTo.d.ts +1 -2
- package/dist/http/routes/postDomScrollTo.d.ts.map +1 -1
- package/dist/http/routes/postDomScrollTo.js +42 -48
- package/dist/http/routes/postDomScrollTo.js.map +1 -1
- package/dist/http/routes/postDomSetFile.d.ts +1 -2
- package/dist/http/routes/postDomSetFile.d.ts.map +1 -1
- package/dist/http/routes/postDomSetFile.js +29 -32
- package/dist/http/routes/postDomSetFile.js.map +1 -1
- package/dist/http/routes/postDomTree.d.ts +1 -2
- package/dist/http/routes/postDomTree.d.ts.map +1 -1
- package/dist/http/routes/postDomTree.js +13 -17
- package/dist/http/routes/postDomTree.js.map +1 -1
- package/dist/http/routes/postEmulation.d.ts +1 -2
- package/dist/http/routes/postEmulation.d.ts.map +1 -1
- package/dist/http/routes/postEmulation.js +29 -39
- package/dist/http/routes/postEmulation.js.map +1 -1
- package/dist/http/routes/postEval.d.ts +1 -2
- package/dist/http/routes/postEval.d.ts.map +1 -1
- package/dist/http/routes/postEval.js +22 -26
- package/dist/http/routes/postEval.js.map +1 -1
- package/dist/http/routes/postLocate.d.ts +2 -4
- package/dist/http/routes/postLocate.d.ts.map +1 -1
- package/dist/http/routes/postLocate.js +40 -60
- package/dist/http/routes/postLocate.js.map +1 -1
- package/dist/http/routes/postNetClear.d.ts +1 -2
- package/dist/http/routes/postNetClear.d.ts.map +1 -1
- package/dist/http/routes/postNetClear.js +14 -13
- package/dist/http/routes/postNetClear.js.map +1 -1
- package/dist/http/routes/postRecord.d.ts +3 -0
- package/dist/http/routes/postRecord.d.ts.map +1 -0
- package/dist/http/routes/postRecord.js +88 -0
- package/dist/http/routes/postRecord.js.map +1 -0
- package/dist/http/routes/postReload.d.ts +1 -2
- package/dist/http/routes/postReload.d.ts.map +1 -1
- package/dist/http/routes/postReload.js +10 -16
- package/dist/http/routes/postReload.js.map +1 -1
- package/dist/http/routes/postScreenshot.d.ts +1 -2
- package/dist/http/routes/postScreenshot.d.ts.map +1 -1
- package/dist/http/routes/postScreenshot.js +11 -22
- package/dist/http/routes/postScreenshot.js.map +1 -1
- package/dist/http/routes/postShutdown.d.ts +1 -2
- package/dist/http/routes/postShutdown.d.ts.map +1 -1
- package/dist/http/routes/postShutdown.js +15 -11
- package/dist/http/routes/postShutdown.js.map +1 -1
- package/dist/http/routes/postSnapshot.d.ts +1 -2
- package/dist/http/routes/postSnapshot.d.ts.map +1 -1
- package/dist/http/routes/postSnapshot.js +21 -26
- package/dist/http/routes/postSnapshot.js.map +1 -1
- package/dist/http/routes/postThrottle.d.ts +1 -2
- package/dist/http/routes/postThrottle.d.ts.map +1 -1
- package/dist/http/routes/postThrottle.js +26 -35
- package/dist/http/routes/postThrottle.js.map +1 -1
- package/dist/http/routes/postTraceStart.d.ts +1 -2
- package/dist/http/routes/postTraceStart.d.ts.map +1 -1
- package/dist/http/routes/postTraceStart.js +8 -16
- package/dist/http/routes/postTraceStart.js.map +1 -1
- package/dist/http/routes/postTraceStop.d.ts +1 -2
- package/dist/http/routes/postTraceStop.d.ts.map +1 -1
- package/dist/http/routes/postTraceStop.js +8 -16
- package/dist/http/routes/postTraceStop.js.map +1 -1
- package/dist/http/routes/postVisibility.d.ts +1 -2
- package/dist/http/routes/postVisibility.d.ts.map +1 -1
- package/dist/http/routes/postVisibility.js +21 -27
- package/dist/http/routes/postVisibility.js.map +1 -1
- package/dist/http/routes/storage.d.ts +2 -4
- package/dist/http/routes/storage.d.ts.map +1 -1
- package/dist/http/routes/storage.js +13 -25
- package/dist/http/routes/storage.js.map +1 -1
- package/dist/http/server.d.ts +6 -1
- package/dist/http/server.d.ts.map +1 -1
- package/dist/http/server.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/native-messaging/control-session-manager.d.ts +36 -0
- package/dist/native-messaging/control-session-manager.d.ts.map +1 -0
- package/dist/native-messaging/control-session-manager.js +96 -0
- package/dist/native-messaging/control-session-manager.js.map +1 -0
- package/dist/native-messaging/messaging.d.ts +4 -4
- package/dist/native-messaging/messaging.d.ts.map +1 -1
- package/dist/native-messaging/messaging.js.map +1 -1
- package/dist/native-messaging/session-manager.d.ts +2 -15
- package/dist/native-messaging/session-manager.d.ts.map +1 -1
- package/dist/native-messaging/session-manager.js +0 -34
- package/dist/native-messaging/session-manager.js.map +1 -1
- package/dist/native-messaging/types.d.ts +78 -2
- package/dist/native-messaging/types.d.ts.map +1 -1
- package/dist/net/NetMockController.d.ts +26 -0
- package/dist/net/NetMockController.d.ts.map +1 -0
- package/dist/net/NetMockController.js +264 -0
- package/dist/net/NetMockController.js.map +1 -0
- package/dist/runtime/watcherServices.d.ts +3 -0
- package/dist/runtime/watcherServices.d.ts.map +1 -1
- package/dist/runtime/watcherServices.js +14 -1
- package/dist/runtime/watcherServices.js.map +1 -1
- package/dist/runtime/watcherSetup.d.ts +3 -0
- package/dist/runtime/watcherSetup.d.ts.map +1 -1
- package/dist/runtime/watcherSetup.js +4 -0
- package/dist/runtime/watcherSetup.js.map +1 -1
- package/dist/scripts/install-host.js +58 -54
- package/dist/scripts/install-host.js.map +1 -1
- package/dist/sources/extension-control-source.d.ts +9 -0
- package/dist/sources/extension-control-source.d.ts.map +1 -0
- package/dist/sources/extension-control-source.js +109 -0
- package/dist/sources/extension-control-source.js.map +1 -0
- package/dist/sources/extension-frame-state.d.ts +5 -0
- package/dist/sources/extension-frame-state.d.ts.map +1 -1
- package/dist/sources/extension-frame-state.js +7 -0
- package/dist/sources/extension-frame-state.js.map +1 -1
- package/dist/sources/extension-source.d.ts +3 -1
- package/dist/sources/extension-source.d.ts.map +1 -1
- package/dist/sources/extension-source.js +50 -137
- package/dist/sources/extension-source.js.map +1 -1
- package/dist/sources/extension-target-recovery.d.ts +32 -0
- package/dist/sources/extension-target-recovery.d.ts.map +1 -0
- package/dist/sources/extension-target-recovery.js +114 -0
- package/dist/sources/extension-target-recovery.js.map +1 -0
- package/dist/sources/types.d.ts +8 -3
- package/dist/sources/types.d.ts.map +1 -1
- package/dist/startWatcherRuntime.d.ts.map +1 -1
- package/dist/startWatcherRuntime.js +12 -2
- package/dist/startWatcherRuntime.js.map +1 -1
- package/package.json +1 -1
- package/dist/http/routes/postStorageLocal.d.ts +0 -2
- package/dist/http/routes/postStorageLocal.d.ts.map +0 -1
- package/dist/http/routes/postStorageLocal.js +0 -3
- package/dist/http/routes/postStorageLocal.js.map +0 -1
- package/dist/http/routes/postStorageSession.d.ts +0 -2
- package/dist/http/routes/postStorageSession.d.ts.map +0 -1
- package/dist/http/routes/postStorageSession.js +0 -3
- package/dist/http/routes/postStorageSession.js.map +0 -1
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
const ICONS = {
|
|
2
|
+
bot: '<path d="M12 8V4H8"/><rect width="16" height="12" x="4" y="8" rx="2"/><path d="M2 14h2"/><path d="M20 14h2"/><path d="M15 13v2"/><path d="M9 13v2"/>',
|
|
3
|
+
copy: '<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>',
|
|
4
|
+
info: '<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>',
|
|
5
|
+
check: '<path d="M20 6 9 17l-5-5"/>',
|
|
6
|
+
error: '<circle cx="12" cy="12" r="10"/><path d="M12 8v4"/><path d="M12 16h.01"/>',
|
|
7
|
+
};
|
|
8
|
+
const COPY_ICON_SIZE = 15;
|
|
9
|
+
const INFO_REVEAL_DELAY_MS = 1500;
|
|
10
|
+
const INFO_REVEAL_DURATION_MS = 100;
|
|
11
|
+
const INFO_BUTTON_GAP_PX = 3;
|
|
12
|
+
const MAIN_FEEDBACK_MS = 1400;
|
|
13
|
+
const DIALOG_COPY_FEEDBACK_MS = 1500;
|
|
14
|
+
const INFO_VISIBLE_CLASS = 'argus-indicator-info-visible';
|
|
15
|
+
const INDICATOR_BUTTON_TRANSITION_PROPS = ['background', 'border-color', 'filter', 'opacity', 'transform'];
|
|
16
|
+
/** Build the page-side installer script that owns all indicator DOM, events, and clipboard feedback. */
|
|
17
|
+
export const buildInstallExpression = (params) => {
|
|
18
|
+
const { info, position, ttlMs, bgColor, hoverBgColor, iconColor, margin, size, state } = params;
|
|
19
|
+
const iconJson = JSON.stringify(ICONS);
|
|
20
|
+
const infoJson = JSON.stringify(info);
|
|
21
|
+
const stateJson = JSON.stringify(state);
|
|
22
|
+
const positionStyle = resolvePositionStyle(position, margin);
|
|
23
|
+
const tooltipText = JSON.stringify(`Argus Watcher: ${info.watcherId}`);
|
|
24
|
+
const buttonSize = size + 12;
|
|
25
|
+
const buttonTransition = buildTransition(INDICATOR_BUTTON_TRANSITION_PROPS, INFO_REVEAL_DURATION_MS);
|
|
26
|
+
return `
|
|
27
|
+
(function() {
|
|
28
|
+
var INDICATOR_ID = 'argus-watcher-indicator';
|
|
29
|
+
var STYLE_ID = 'argus-watcher-indicator-style';
|
|
30
|
+
var DIALOG_ID = 'argus-watcher-indicator-dialog';
|
|
31
|
+
var STATE_KEY = '__ARGUS_WATCHER_INDICATOR__';
|
|
32
|
+
var INFO_VISIBLE_CLASS = '${INFO_VISIBLE_CLASS}';
|
|
33
|
+
var ICONS = ${iconJson};
|
|
34
|
+
var info = ${infoJson};
|
|
35
|
+
var indicatorState = ${stateJson};
|
|
36
|
+
var ttlMs = ${ttlMs};
|
|
37
|
+
var isHovering = false;
|
|
38
|
+
var infoVisible = false;
|
|
39
|
+
var infoRevealTimer = null;
|
|
40
|
+
var feedbackTimer = null;
|
|
41
|
+
|
|
42
|
+
removeExistingIndicator();
|
|
43
|
+
installStyle();
|
|
44
|
+
|
|
45
|
+
var wrapper = document.createElement('div');
|
|
46
|
+
wrapper.id = INDICATOR_ID;
|
|
47
|
+
wrapper.setAttribute('data-testid', INDICATOR_ID);
|
|
48
|
+
|
|
49
|
+
var mainButton = createIconButton('argus-indicator-main', 'Argus watcher: copy info', ${tooltipText}, 'bot');
|
|
50
|
+
var recordingDot = document.createElement('span');
|
|
51
|
+
recordingDot.className = 'argus-indicator-recording-dot';
|
|
52
|
+
recordingDot.setAttribute('aria-hidden', 'true');
|
|
53
|
+
mainButton.appendChild(recordingDot);
|
|
54
|
+
var infoButton = createIconButton('argus-indicator-info', 'Argus watcher details', 'Watcher details', 'info');
|
|
55
|
+
wrapper.appendChild(mainButton);
|
|
56
|
+
wrapper.appendChild(infoButton);
|
|
57
|
+
|
|
58
|
+
// Delay starts on the main button only; once revealed, the info button stays clickable until the whole indicator is left.
|
|
59
|
+
wrapper.addEventListener('mouseleave', function() {
|
|
60
|
+
setInfoVisible(false);
|
|
61
|
+
});
|
|
62
|
+
mainButton.addEventListener('mouseenter', function() {
|
|
63
|
+
isHovering = true;
|
|
64
|
+
scheduleInfoReveal();
|
|
65
|
+
if (!feedbackTimer) setMainIcon('copy');
|
|
66
|
+
});
|
|
67
|
+
mainButton.addEventListener('mouseleave', function() {
|
|
68
|
+
isHovering = false;
|
|
69
|
+
cancelInfoReveal();
|
|
70
|
+
if (!feedbackTimer) setMainIcon('bot');
|
|
71
|
+
});
|
|
72
|
+
mainButton.addEventListener('click', function() {
|
|
73
|
+
copyWatcherInfo().then(function() {
|
|
74
|
+
showMainFeedback('check');
|
|
75
|
+
}).catch(function() {
|
|
76
|
+
showMainFeedback('error');
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
infoButton.addEventListener('click', function(event) {
|
|
80
|
+
event.stopPropagation();
|
|
81
|
+
openWatcherDialog();
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
document.documentElement.appendChild(wrapper);
|
|
85
|
+
|
|
86
|
+
var timerId = setInterval(function() {
|
|
87
|
+
var state = window[STATE_KEY];
|
|
88
|
+
if (!state) {
|
|
89
|
+
clearInterval(timerId);
|
|
90
|
+
removeExistingIndicator();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (Date.now() - state.lastSeenMs > state.ttlMs) {
|
|
94
|
+
clearInterval(state.timerId);
|
|
95
|
+
removeExistingIndicator();
|
|
96
|
+
delete window[STATE_KEY];
|
|
97
|
+
}
|
|
98
|
+
}, 1000);
|
|
99
|
+
|
|
100
|
+
window[STATE_KEY] = {
|
|
101
|
+
lastSeenMs: Date.now(),
|
|
102
|
+
ttlMs: ttlMs,
|
|
103
|
+
timerId: timerId,
|
|
104
|
+
info: info,
|
|
105
|
+
recording: indicatorState.recording === true
|
|
106
|
+
};
|
|
107
|
+
applyIndicatorState(indicatorState);
|
|
108
|
+
|
|
109
|
+
function installStyle() {
|
|
110
|
+
var existingStyle = document.getElementById(STYLE_ID);
|
|
111
|
+
if (existingStyle) existingStyle.remove();
|
|
112
|
+
|
|
113
|
+
var style = document.createElement('style');
|
|
114
|
+
style.id = STYLE_ID;
|
|
115
|
+
style.textContent =
|
|
116
|
+
'#' + INDICATOR_ID + ' {' +
|
|
117
|
+
'position: fixed; ${positionStyle} z-index: 2147483647; display: flex; align-items: center; justify-content: center; gap: 0px; ' +
|
|
118
|
+
'color: ${iconColor}; user-select: none; pointer-events: auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;' +
|
|
119
|
+
'}' +
|
|
120
|
+
'#' + INDICATOR_ID + ' .argus-indicator-button {' +
|
|
121
|
+
'width: ${buttonSize}px; height: ${buttonSize}px; box-sizing: border-box; border: 1px solid rgba(255, 255, 255, 0.12); ' +
|
|
122
|
+
'border-radius: 7px; padding: 6px; display: flex; align-items: center; justify-content: center; color: ${iconColor}; ' +
|
|
123
|
+
'background: ${bgColor}; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22); cursor: pointer; transition: ${buttonTransition};' +
|
|
124
|
+
'}' +
|
|
125
|
+
'#' + INDICATOR_ID + ' .argus-indicator-main { position: relative; }' +
|
|
126
|
+
'#' + INDICATOR_ID + ' .argus-indicator-button:hover {' +
|
|
127
|
+
'background: ${hoverBgColor}; border-color: rgba(255, 255, 255, 0.22); filter: brightness(1.15);' +
|
|
128
|
+
'}' +
|
|
129
|
+
'#' + INDICATOR_ID + ' .argus-indicator-icon { display: flex; align-items: center; justify-content: center; }' +
|
|
130
|
+
'#' + INDICATOR_ID + ' .argus-indicator-button svg {' +
|
|
131
|
+
'max-width: ${size}px; max-height: ${size}px; flex: 0 0 auto; display: block;' +
|
|
132
|
+
'}' +
|
|
133
|
+
'#' + INDICATOR_ID + ' .argus-indicator-recording-dot {' +
|
|
134
|
+
'position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 999px; pointer-events: none; opacity: 0; ' +
|
|
135
|
+
'background: #ef4444; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.72), 0 0 12px rgba(239, 68, 68, 0.95); ' +
|
|
136
|
+
'opacity: var(--argus-recording-dot-opacity, 0); transform: scale(var(--argus-recording-dot-scale, 0.72)); ' +
|
|
137
|
+
'animation: var(--argus-recording-dot-animation, none); transition: opacity 120ms ease, transform 120ms ease;' +
|
|
138
|
+
'}' +
|
|
139
|
+
'@keyframes argus-indicator-recording-pulse {' +
|
|
140
|
+
'0%, 100% { box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.72), 0 0 10px rgba(239, 68, 68, 0.75); }' +
|
|
141
|
+
'50% { box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.72), 0 0 18px rgba(239, 68, 68, 1); }' +
|
|
142
|
+
'}' +
|
|
143
|
+
'#' + INDICATOR_ID + ' .argus-indicator-info {' +
|
|
144
|
+
'position: absolute; right: 0; bottom: calc(100% + ${INFO_BUTTON_GAP_PX}px); opacity: 0; pointer-events: none; transform: translateY(2px);' +
|
|
145
|
+
'}' +
|
|
146
|
+
'#' + INDICATOR_ID + ' .argus-indicator-info-visible {' +
|
|
147
|
+
'opacity: 1; pointer-events: auto; transform: translateY(0);' +
|
|
148
|
+
'}' +
|
|
149
|
+
'#' + DIALOG_ID + '::backdrop { background: rgba(0, 0, 0, 0.5); }' +
|
|
150
|
+
'#' + DIALOG_ID + ' {' +
|
|
151
|
+
'border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 10px; background: #1a1a1a; color: #e0e0e0; padding: 0; ' +
|
|
152
|
+
'min-width: 320px; max-width: 480px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 13px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);' +
|
|
153
|
+
'}' +
|
|
154
|
+
'#' + DIALOG_ID + ' .argus-dialog-header { padding: 14px 18px 10px; font-size: 14px; font-weight: 600; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }' +
|
|
155
|
+
'#' + DIALOG_ID + ' .argus-dialog-body { padding: 12px 18px; }' +
|
|
156
|
+
'#' + DIALOG_ID + ' .argus-dialog-row { display: flex; padding: 4px 0; gap: 12px; }' +
|
|
157
|
+
'#' + DIALOG_ID + ' .argus-dialog-label { flex-shrink: 0; width: 70px; color: rgba(255, 255, 255, 0.5); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; padding-top: 1px; }' +
|
|
158
|
+
'#' + DIALOG_ID + ' .argus-dialog-value { color: #e0e0e0; word-break: break-all; }' +
|
|
159
|
+
'#' + DIALOG_ID + ' .argus-dialog-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 18px 14px; border-top: 1px solid rgba(255, 255, 255, 0.1); }' +
|
|
160
|
+
'#' + DIALOG_ID + ' button { border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px; padding: 6px 16px; font-size: 13px; cursor: pointer; background: rgba(255, 255, 255, 0.08); color: #e0e0e0; }' +
|
|
161
|
+
'#' + DIALOG_ID + ' button:hover { background: rgba(255, 255, 255, 0.15); }';
|
|
162
|
+
document.documentElement.appendChild(style);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function createIconButton(className, ariaLabel, title, iconName) {
|
|
166
|
+
var button = document.createElement('button');
|
|
167
|
+
button.type = 'button';
|
|
168
|
+
button.className = 'argus-indicator-button ' + className;
|
|
169
|
+
button.setAttribute('aria-label', ariaLabel);
|
|
170
|
+
button.setAttribute('title', title);
|
|
171
|
+
button.innerHTML = '<span class="argus-indicator-icon">' + renderIcon(iconName) + '</span>';
|
|
172
|
+
return button;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function setMainIcon(iconName) {
|
|
176
|
+
var iconEl = mainButton.querySelector('.argus-indicator-icon');
|
|
177
|
+
if (iconEl) iconEl.innerHTML = renderIcon(iconName);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function applyIndicatorState(nextState) {
|
|
181
|
+
var isRecording = nextState && nextState.recording === true;
|
|
182
|
+
wrapper.classList.toggle('argus-indicator-recording', isRecording);
|
|
183
|
+
wrapper.setAttribute('data-recording', isRecording ? 'true' : 'false');
|
|
184
|
+
wrapper.style.setProperty('--argus-recording-dot-opacity', isRecording ? '1' : '0');
|
|
185
|
+
wrapper.style.setProperty('--argus-recording-dot-scale', isRecording ? '1' : '0.72');
|
|
186
|
+
wrapper.style.setProperty('--argus-recording-dot-animation', isRecording ? 'argus-indicator-recording-pulse 1.15s ease-in-out infinite' : 'none');
|
|
187
|
+
mainButton.setAttribute('title', isRecording ? 'Argus watcher: recording - copy info' : ${tooltipText});
|
|
188
|
+
mainButton.setAttribute('aria-label', isRecording ? 'Argus watcher recording: copy info' : 'Argus watcher: copy info');
|
|
189
|
+
var state = window[STATE_KEY];
|
|
190
|
+
if (state) state.recording = isRecording;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function scheduleInfoReveal() {
|
|
194
|
+
cancelInfoReveal();
|
|
195
|
+
if (infoVisible) return;
|
|
196
|
+
infoRevealTimer = setTimeout(function() {
|
|
197
|
+
infoRevealTimer = null;
|
|
198
|
+
setInfoVisible(true);
|
|
199
|
+
}, ${INFO_REVEAL_DELAY_MS});
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function cancelInfoReveal() {
|
|
203
|
+
if (!infoRevealTimer) return;
|
|
204
|
+
clearTimeout(infoRevealTimer);
|
|
205
|
+
infoRevealTimer = null;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function setInfoVisible(visible) {
|
|
209
|
+
if (!visible) cancelInfoReveal();
|
|
210
|
+
infoVisible = visible;
|
|
211
|
+
infoButton.classList.toggle(INFO_VISIBLE_CLASS, visible);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function showMainFeedback(iconName) {
|
|
215
|
+
if (feedbackTimer) clearTimeout(feedbackTimer);
|
|
216
|
+
setMainIcon(iconName);
|
|
217
|
+
feedbackTimer = setTimeout(function() {
|
|
218
|
+
feedbackTimer = null;
|
|
219
|
+
setMainIcon(isHovering ? 'copy' : 'bot');
|
|
220
|
+
}, ${MAIN_FEEDBACK_MS});
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function openWatcherDialog() {
|
|
224
|
+
var fields = getWatcherFields();
|
|
225
|
+
var dialog = document.getElementById(DIALOG_ID);
|
|
226
|
+
if (!dialog) {
|
|
227
|
+
dialog = document.createElement('dialog');
|
|
228
|
+
dialog.id = DIALOG_ID;
|
|
229
|
+
dialog.addEventListener('click', function(e) {
|
|
230
|
+
if (e.target === dialog) dialog.close();
|
|
231
|
+
});
|
|
232
|
+
document.documentElement.appendChild(dialog);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
var html = '<div class="argus-dialog-header">Argus Watcher</div><div class="argus-dialog-body">';
|
|
236
|
+
for (var f = 0; f < fields.length; f++) {
|
|
237
|
+
html += '<div class="argus-dialog-row">' +
|
|
238
|
+
'<span class="argus-dialog-label">' + escapeHtml(fields[f][0]) + '</span>' +
|
|
239
|
+
'<span class="argus-dialog-value">' + escapeHtml(fields[f][1]) + '</span>' +
|
|
240
|
+
'</div>';
|
|
241
|
+
}
|
|
242
|
+
html += '</div><div class="argus-dialog-footer">' +
|
|
243
|
+
'<button data-action="copy" type="button">Copy</button>' +
|
|
244
|
+
'<button data-action="close" type="button">Close</button>' +
|
|
245
|
+
'</div>';
|
|
246
|
+
dialog.innerHTML = html;
|
|
247
|
+
|
|
248
|
+
dialog.querySelector('[data-action="copy"]').addEventListener('click', function() {
|
|
249
|
+
copyWatcherInfo().then(function() {
|
|
250
|
+
var btn = dialog.querySelector('[data-action="copy"]');
|
|
251
|
+
if (btn) {
|
|
252
|
+
btn.textContent = 'Copied!';
|
|
253
|
+
setTimeout(function() { btn.textContent = 'Copy'; }, ${DIALOG_COPY_FEEDBACK_MS});
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
});
|
|
257
|
+
dialog.querySelector('[data-action="close"]').addEventListener('click', function() {
|
|
258
|
+
dialog.close();
|
|
259
|
+
});
|
|
260
|
+
dialog.showModal();
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
function copyWatcherInfo() {
|
|
264
|
+
return copyText(buildWatcherInfoText());
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function copyText(text) {
|
|
268
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
269
|
+
return navigator.clipboard.writeText(text).catch(function() {
|
|
270
|
+
return copyTextFallback(text);
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
return copyTextFallback(text);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function copyTextFallback(text) {
|
|
277
|
+
var textarea = document.createElement('textarea');
|
|
278
|
+
textarea.value = text;
|
|
279
|
+
textarea.setAttribute('readonly', '');
|
|
280
|
+
textarea.style.cssText = 'position: fixed; left: -9999px; top: 0; opacity: 0;';
|
|
281
|
+
document.body.appendChild(textarea);
|
|
282
|
+
textarea.focus();
|
|
283
|
+
textarea.select();
|
|
284
|
+
try {
|
|
285
|
+
if (!document.execCommand('copy')) throw new Error('copy command denied');
|
|
286
|
+
return Promise.resolve();
|
|
287
|
+
} catch (error) {
|
|
288
|
+
return Promise.reject(error);
|
|
289
|
+
} finally {
|
|
290
|
+
textarea.remove();
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function buildWatcherInfoText() {
|
|
295
|
+
var fields = getWatcherFields();
|
|
296
|
+
var text = 'Argus Watcher Info\\n';
|
|
297
|
+
for (var i = 0; i < fields.length; i++) {
|
|
298
|
+
text += fields[i][0] + ': ' + fields[i][1] + '\\n';
|
|
299
|
+
}
|
|
300
|
+
return text.trim();
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function getWatcherFields() {
|
|
304
|
+
var state = window[STATE_KEY];
|
|
305
|
+
var i = state ? state.info : info;
|
|
306
|
+
var isRecording = state ? state.recording === true : indicatorState.recording === true;
|
|
307
|
+
return [
|
|
308
|
+
['ID', i.watcherId],
|
|
309
|
+
['Host', i.watcherHost + ':' + i.watcherPort],
|
|
310
|
+
['PID', String(i.watcherPid)],
|
|
311
|
+
['Target', i.targetTitle || '(no title)'],
|
|
312
|
+
['URL', i.targetUrl || '(no url)'],
|
|
313
|
+
['Attached', new Date(i.attachedAt).toISOString()],
|
|
314
|
+
['Recording', isRecording ? 'active' : 'inactive']
|
|
315
|
+
];
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function renderIcon(iconName) {
|
|
319
|
+
var iconSize = iconName === 'copy' ? '${COPY_ICON_SIZE}' : '${size}';
|
|
320
|
+
return '<svg xmlns="http://www.w3.org/2000/svg" width="' + iconSize + '" height="' + iconSize + '" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">' + ICONS[iconName] + '</svg>';
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function escapeHtml(value) {
|
|
324
|
+
return String(value).replace(/[&<>"']/g, function(char) {
|
|
325
|
+
return ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[char];
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
function removeExistingIndicator() {
|
|
330
|
+
var existing = document.getElementById(INDICATOR_ID);
|
|
331
|
+
if (existing) existing.remove();
|
|
332
|
+
if (window[STATE_KEY] && window[STATE_KEY].timerId) clearInterval(window[STATE_KEY].timerId);
|
|
333
|
+
}
|
|
334
|
+
})();
|
|
335
|
+
`;
|
|
336
|
+
};
|
|
337
|
+
/** Build a cheap page-side heartbeat/state update; the installed script keeps the DOM and TTL timer. */
|
|
338
|
+
export const buildHeartbeatExpression = (info, state) => {
|
|
339
|
+
const infoJson = JSON.stringify(info);
|
|
340
|
+
const stateJson = JSON.stringify(state);
|
|
341
|
+
const tooltipText = JSON.stringify(`Argus Watcher: ${info.watcherId}`);
|
|
342
|
+
return `
|
|
343
|
+
(function() {
|
|
344
|
+
var INDICATOR_ID = 'argus-watcher-indicator';
|
|
345
|
+
var STATE_KEY = '__ARGUS_WATCHER_INDICATOR__';
|
|
346
|
+
var nextState = ${stateJson};
|
|
347
|
+
var state = window[STATE_KEY];
|
|
348
|
+
if (state) {
|
|
349
|
+
state.lastSeenMs = Date.now();
|
|
350
|
+
state.info = ${infoJson};
|
|
351
|
+
state.recording = nextState.recording === true;
|
|
352
|
+
var indicator = document.getElementById(INDICATOR_ID);
|
|
353
|
+
if (indicator) {
|
|
354
|
+
indicator.classList.toggle('argus-indicator-recording', state.recording);
|
|
355
|
+
indicator.setAttribute('data-recording', state.recording ? 'true' : 'false');
|
|
356
|
+
indicator.style.setProperty('--argus-recording-dot-opacity', state.recording ? '1' : '0');
|
|
357
|
+
indicator.style.setProperty('--argus-recording-dot-scale', state.recording ? '1' : '0.72');
|
|
358
|
+
indicator.style.setProperty('--argus-recording-dot-animation', state.recording ? 'argus-indicator-recording-pulse 1.15s ease-in-out infinite' : 'none');
|
|
359
|
+
var mainButton = indicator.querySelector('.argus-indicator-main');
|
|
360
|
+
if (mainButton) {
|
|
361
|
+
mainButton.setAttribute('title', state.recording ? 'Argus watcher: recording - copy info' : ${tooltipText});
|
|
362
|
+
mainButton.setAttribute('aria-label', state.recording ? 'Argus watcher recording: copy info' : 'Argus watcher: copy info');
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
})();
|
|
367
|
+
`;
|
|
368
|
+
};
|
|
369
|
+
/** Build the cleanup script used on watcher detach/stop. */
|
|
370
|
+
export const buildRemoveExpression = () => {
|
|
371
|
+
return `
|
|
372
|
+
(function() {
|
|
373
|
+
var INDICATOR_ID = 'argus-watcher-indicator';
|
|
374
|
+
var STYLE_ID = 'argus-watcher-indicator-style';
|
|
375
|
+
var DIALOG_ID = 'argus-watcher-indicator-dialog';
|
|
376
|
+
var STATE_KEY = '__ARGUS_WATCHER_INDICATOR__';
|
|
377
|
+
var state = window[STATE_KEY];
|
|
378
|
+
if (state && state.timerId) {
|
|
379
|
+
clearInterval(state.timerId);
|
|
380
|
+
}
|
|
381
|
+
delete window[STATE_KEY];
|
|
382
|
+
var el = document.getElementById(INDICATOR_ID);
|
|
383
|
+
if (el) el.remove();
|
|
384
|
+
var styleEl = document.getElementById(STYLE_ID);
|
|
385
|
+
if (styleEl) styleEl.remove();
|
|
386
|
+
var dialogEl = document.getElementById(DIALOG_ID);
|
|
387
|
+
if (dialogEl) dialogEl.remove();
|
|
388
|
+
})();
|
|
389
|
+
`;
|
|
390
|
+
};
|
|
391
|
+
const buildTransition = (properties, durationMs) => properties.map((property) => `${property} ${durationMs}ms ease`).join(', ');
|
|
392
|
+
const resolvePositionStyle = (position, margin) => {
|
|
393
|
+
const styles = {
|
|
394
|
+
'top-left': `top: ${margin}px; left: ${margin}px;`,
|
|
395
|
+
'top-center': `top: ${margin}px; left: 50%; transform: translateX(-50%);`,
|
|
396
|
+
'top-right': `top: ${margin}px; right: ${margin}px;`,
|
|
397
|
+
'bottom-left': `bottom: ${margin}px; left: ${margin}px;`,
|
|
398
|
+
'bottom-center': `bottom: ${margin}px; left: 50%; transform: translateX(-50%);`,
|
|
399
|
+
'bottom-right': `bottom: ${margin}px; right: ${margin}px;`,
|
|
400
|
+
'left-center': `top: 50%; left: ${margin}px; transform: translateY(-50%);`,
|
|
401
|
+
'right-center': `top: 50%; right: ${margin}px; transform: translateY(-50%);`,
|
|
402
|
+
};
|
|
403
|
+
return styles[position];
|
|
404
|
+
};
|
|
405
|
+
//# sourceMappingURL=pageIndicatorScript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pageIndicatorScript.js","sourceRoot":"","sources":["../../src/cdp/pageIndicatorScript.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RecordRequest, RecordStartRequest, RecordStartResponse, RecordStopRequest, RecordStopResponse } from '@vforsh/argus-core';
|
|
2
|
+
import type { CdpSessionHandle } from './connection.js';
|
|
3
|
+
export type Recorder = {
|
|
4
|
+
capture: (request: RecordRequest) => Promise<RecordStopResponse>;
|
|
5
|
+
start: (request: RecordStartRequest) => Promise<RecordStartResponse>;
|
|
6
|
+
stop: (request: RecordStopRequest) => Promise<RecordStopResponse>;
|
|
7
|
+
onDetached: (reason?: string) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const createRecorder: (options: {
|
|
10
|
+
session: CdpSessionHandle;
|
|
11
|
+
pageSession?: CdpSessionHandle;
|
|
12
|
+
artifactsDir: string;
|
|
13
|
+
onRecordingStateChange?: (recording: boolean) => void;
|
|
14
|
+
}) => Recorder;
|
|
15
|
+
//# sourceMappingURL=recording.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recording.d.ts","sourceRoot":"","sources":["../../src/cdp/recording.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAgB,aAAa,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AACrJ,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAwCvD,MAAM,MAAM,QAAQ,GAAG;IACtB,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAA;IAChE,KAAK,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAA;IACpE,IAAI,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAA;IACjE,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CACrC,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,SAAS;IACvC,OAAO,EAAE,gBAAgB,CAAA;IACzB,WAAW,CAAC,EAAE,gBAAgB,CAAA;IAC9B,YAAY,EAAE,MAAM,CAAA;IACpB,sBAAsB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;CACrD,KAAG,QA0KH,CAAA"}
|