@rezkam/browser-tools 1.0.1 → 1.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rezkam/browser-tools",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Sandboxed, owner-token-protected Chrome automation for AI agents: control pages, record and review GIFs, capture HAR and raw CDP events, send CDP calls, and manage Chrome profiles.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -1941,6 +1941,11 @@ export function stopChrome({ port = DEFAULT_PORT, clean = false, dryRun = false,
1941
1941
  if (status === 'failed') {
1942
1942
  error = new Error('Managed Chrome remained alive after SIGKILL');
1943
1943
  }
1944
+ } else if (killSafety.reason === 'process-not-found' && !processExists(pid)) {
1945
+ // Chrome can exit after the final SIGTERM wait check and before the safety recheck obtains
1946
+ // its command line. It is then safe to complete normal already-gone cleanup, but only after
1947
+ // independently confirming that the PID has not survived or been recycled.
1948
+ status = 'already-gone';
1944
1949
  } else {
1945
1950
  status = 'failed';
1946
1951
  error = new Error(`Refusing SIGKILL after failed safety recheck: ${killSafety.reason}`);