patchrome 0.1.0 → 0.1.1

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/engine.js CHANGED
@@ -7,8 +7,9 @@ import { chromium } from "patchright";
7
7
  import { keepFocusDuring } from "./focus.js";
8
8
  import { readOriginStorageInPage } from "./origin-storage.js";
9
9
  const pageOpenTimeoutMs = 15_000;
10
- // Chrome can raise its window shortly after launch resolves.
11
- const focusGraceMs = 3_000;
10
+ // Chrome activates 400-800ms into launch, before launch resolves. A longer grace sends the user's own
11
+ // Dock clicks on Chrome back to the previous app.
12
+ const focusGraceMs = 500;
12
13
  const devToolsPortWaitMs = 10_000;
13
14
  const extensionWorkerWaitMs = 10_000;
14
15
  // src/ and dist/ both sit one level below the package root, next to extension/.
package/dist/focus.js CHANGED
@@ -14,8 +14,8 @@ async function frontmostBundleId() {
14
14
  }
15
15
  // macOS activates Chrome when its first window appears, so keystrokes meant for the user's editor land in
16
16
  // the address bar. Chrome has no flag to launch in the background, and --no-startup-window stalls Playwright,
17
- // so this watches the launch and reactivates whichever app was in front. Chrome can activate more than once
18
- // while its first window settles, so the watch keeps going until the grace period ends. `open -b` needs no Apple Events
17
+ // so this watches the launch and reactivates whichever app was in front. The watch covers the launch and a short
18
+ // grace after it, since it cannot tell Chrome raising itself from the user clicking Chrome. `open -b` needs no Apple Events
19
19
  // permission, unlike osascript.
20
20
  export async function keepFocusDuring(launch, graceMs) {
21
21
  if (process.platform !== "darwin")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchrome",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Stealth shared-browser CLI for coding agents: one Patchright Chrome, a tab set per agent session",
5
5
  "homepage": "https://github.com/akaike-byob/patchrome#readme",
6
6
  "bugs": {