chrome-relay 0.5.16 → 0.5.18
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/cli.js +72 -2
- package/dist/index.js +1 -1
- package/dist/native-host.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -828,6 +828,54 @@ var init_multi = __esm({
|
|
|
828
828
|
});
|
|
829
829
|
|
|
830
830
|
// ../protocol/dist/args/index.js
|
|
831
|
+
function parseToolArgs(name, input) {
|
|
832
|
+
switch (name) {
|
|
833
|
+
case "get_windows_and_tabs":
|
|
834
|
+
return parseGetWindowsAndTabsArgs(input);
|
|
835
|
+
case "chrome_navigate":
|
|
836
|
+
return parseChromeNavigateArgs(input);
|
|
837
|
+
case "chrome_switch_tab":
|
|
838
|
+
return parseChromeSwitchTabArgs(input);
|
|
839
|
+
case "chrome_close_tabs":
|
|
840
|
+
return parseChromeCloseTabsArgs(input);
|
|
841
|
+
case "chrome_screenshot":
|
|
842
|
+
return parseChromeScreenshotArgs(input);
|
|
843
|
+
case "chrome_read_page":
|
|
844
|
+
return parseChromeReadPageArgs(input);
|
|
845
|
+
case "chrome_click_element":
|
|
846
|
+
return parseChromeClickArgs(input);
|
|
847
|
+
case "chrome_fill_or_select":
|
|
848
|
+
return parseChromeFillArgs(input);
|
|
849
|
+
case "chrome_keyboard":
|
|
850
|
+
return parseChromeKeyboardArgs(input);
|
|
851
|
+
case "chrome_type":
|
|
852
|
+
return parseChromeTypeArgs(input);
|
|
853
|
+
case "chrome_evaluate":
|
|
854
|
+
return parseChromeEvaluateArgs(input);
|
|
855
|
+
case "chrome_viewport":
|
|
856
|
+
return parseChromeViewportArgs(input);
|
|
857
|
+
case "chrome_self_reload":
|
|
858
|
+
return parseChromeSelfReloadArgs(input);
|
|
859
|
+
case "chrome_console":
|
|
860
|
+
return parseChromeConsoleArgs(input);
|
|
861
|
+
case "chrome_workspace":
|
|
862
|
+
return parseChromeWorkspaceArgs(input);
|
|
863
|
+
case "chrome_group":
|
|
864
|
+
return parseChromeGroupArgs(input);
|
|
865
|
+
case "chrome_ax":
|
|
866
|
+
return parseChromeAxArgs(input);
|
|
867
|
+
case "chrome_click_ax":
|
|
868
|
+
return parseChromeClickAxArgs(input);
|
|
869
|
+
case "chrome_network":
|
|
870
|
+
return parseChromeNetworkArgs(input);
|
|
871
|
+
case "chrome_hover":
|
|
872
|
+
return parseChromeHoverArgs(input);
|
|
873
|
+
case "chrome_screencast":
|
|
874
|
+
return parseChromeScreencastArgs(input);
|
|
875
|
+
}
|
|
876
|
+
const exhaustive = name;
|
|
877
|
+
return exhaustive;
|
|
878
|
+
}
|
|
831
879
|
var init_args = __esm({
|
|
832
880
|
"../protocol/dist/args/index.js"() {
|
|
833
881
|
"use strict";
|
|
@@ -837,6 +885,11 @@ var init_args = __esm({
|
|
|
837
885
|
init_network();
|
|
838
886
|
init_simple();
|
|
839
887
|
init_multi();
|
|
888
|
+
init_navigate();
|
|
889
|
+
init_hover();
|
|
890
|
+
init_network();
|
|
891
|
+
init_simple();
|
|
892
|
+
init_multi();
|
|
840
893
|
}
|
|
841
894
|
});
|
|
842
895
|
|
|
@@ -911,6 +964,7 @@ __export(dist_exports, {
|
|
|
911
964
|
parseChromeWorkspaceArgs: () => parseChromeWorkspaceArgs,
|
|
912
965
|
parseGetWindowsAndTabsArgs: () => parseGetWindowsAndTabsArgs,
|
|
913
966
|
parseTargetArgs: () => parseTargetArgs,
|
|
967
|
+
parseToolArgs: () => parseToolArgs,
|
|
914
968
|
requireString: () => requireString,
|
|
915
969
|
toBridgeError: () => toBridgeError
|
|
916
970
|
});
|
|
@@ -1023,7 +1077,7 @@ var init_dist = __esm({
|
|
|
1023
1077
|
import { Command } from "commander";
|
|
1024
1078
|
|
|
1025
1079
|
// src/index.ts
|
|
1026
|
-
var CHROME_RELAY_VERSION = true ? "0.5.
|
|
1080
|
+
var CHROME_RELAY_VERSION = true ? "0.5.18" : "0.0.0-dev";
|
|
1027
1081
|
|
|
1028
1082
|
// src/commands/shared.ts
|
|
1029
1083
|
init_dist();
|
|
@@ -1131,7 +1185,8 @@ function emitTargetOverride(kind, from, to) {
|
|
|
1131
1185
|
}
|
|
1132
1186
|
async function runToolImpl(name, args) {
|
|
1133
1187
|
try {
|
|
1134
|
-
const
|
|
1188
|
+
const parsedArgs = isToolName(name) ? parseToolArgs(name, args) : args;
|
|
1189
|
+
const result = await callTool(name, parsedArgs);
|
|
1135
1190
|
if (typeof result === "string") {
|
|
1136
1191
|
process.stdout.write(result + "\n");
|
|
1137
1192
|
} else {
|
|
@@ -1150,6 +1205,9 @@ async function runToolImpl(name, args) {
|
|
|
1150
1205
|
}
|
|
1151
1206
|
}
|
|
1152
1207
|
var runTool = runToolImpl;
|
|
1208
|
+
function isToolName(name) {
|
|
1209
|
+
return Object.values(TOOL_NAMES).includes(name);
|
|
1210
|
+
}
|
|
1153
1211
|
|
|
1154
1212
|
// src/install/install.ts
|
|
1155
1213
|
init_dist();
|
|
@@ -1262,6 +1320,18 @@ async function runDoctor() {
|
|
|
1262
1320
|
|
|
1263
1321
|
// src/release-notes.ts
|
|
1264
1322
|
var RELEASE_NOTES = {
|
|
1323
|
+
"0.5.18": [
|
|
1324
|
+
"Force-visible on attach \u2014 actually fixes Cloudflare-style SPAs now. 0.5.17 had two bugs: (1) missing `Page.enable` before `Page.addScriptToEvaluateOnNewDocument` (the script registration silently failed, so the shim only applied to the current doc \u2014 page reloads dropped it), (2) the JS shim used one try-block so a deprecated `Object.defineProperty(document, 'webkitVisibilityState')` could throw and skip the `document.hasFocus` patch.",
|
|
1325
|
+
"0.5.18 fixes both: enables Page domain first, then applies each patch in its own try/catch. New patches added: `document.hasFocus` (overridden on both instance and Document.prototype), `Emulation.setFocusEmulationEnabled` via CDP, `document.wasDiscarded`. End result: Cloudflare Web Analytics dashboard now fully renders on backgrounded tabs without focus theft (verified live).",
|
|
1326
|
+
"Reverted the `navigate --new` about:blank trampoline from 0.5.17. It was opening about:blank as a stepping stone to attach before page JS ran; user-visible as a ~200ms flash. Removed \u2014 the addScriptToEvaluateOnNewDocument registration in 0.5.18 is robust enough that subsequent reloads pick up the shim cleanly.",
|
|
1327
|
+
"Honest caveat: shim covers visibility + focus gates. If a page detects automation via other means (chrome.runtime.connect probe, navigator.webdriver, debugger evaluation traces), chrome-relay won't help \u2014 those need stealth-mode workarounds separate from visibility."
|
|
1328
|
+
],
|
|
1329
|
+
"0.5.17": [
|
|
1330
|
+
"Force-visible on attach (default-on). Modern SPAs (Cloudflare dashboard, Linear, Notion) gate their JS on `document.visibilityState` and stall on backgrounded tabs \u2014 chrome-relay's whole pitch is operate-without-stealing-focus, and that pitch silently broke whenever the page was visibility-gated. Fix runs three CDP calls on every attach: `Page.setWebLifecycleState({state:'active'})` to stop Chrome's rAF/timer throttling, plus a JS shim (installed via `Page.addScriptToEvaluateOnNewDocument` AND `Runtime.evaluate`) that overrides `document.visibilityState` / `document.hidden` so the page's own checks see 'visible.'",
|
|
1331
|
+
"Scoped to debugger-attached tabs only \u2014 other tabs the user has open stay normally throttled. Override clears when chrome-relay detaches. User's viewport never changes.",
|
|
1332
|
+
"Behavioral guidance: never call `chrome-relay switch` to make a backgrounded SPA render \u2014 it stalls because of visibility gating, not chrome-relay. The new attach behavior fixes it invisibly.",
|
|
1333
|
+
"Tests: +4 in apps/extension/test/force-visibility.test.ts. Total 426 (was 422)."
|
|
1334
|
+
],
|
|
1265
1335
|
"0.5.16": [
|
|
1266
1336
|
"chrome_hover now rejects partial-coordinate intent (`--x 10` without `--y`, or vice versa) instead of silently falling through to selector-mode and losing the half-passed coordinate. CLI forwards even partial input so the protocol parser sees it.",
|
|
1267
1337
|
"Network body errors are now structured RelayError instead of plain Error. `getBody` for a request that's not in the buffer \u2192 `target_not_found`; CDP failure (Chrome GC'd the body, permission denied, etc.) \u2192 `cdp_error` with the original message under `details.underlying`. Agents can branch on the code instead of pattern-matching the message.",
|
package/dist/index.js
CHANGED
package/dist/native-host.js
CHANGED
|
@@ -56,7 +56,7 @@ function toBridgeError(unknownErr, fallbackTool) {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// src/index.ts
|
|
59
|
-
var CHROME_RELAY_VERSION = true ? "0.5.
|
|
59
|
+
var CHROME_RELAY_VERSION = true ? "0.5.18" : "0.0.0-dev";
|
|
60
60
|
|
|
61
61
|
// src/release-notes.ts
|
|
62
62
|
function compareSemver(a, b) {
|