@browserless.io/cli 0.0.2 → 0.0.3
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/CHANGELOG.md +11 -0
- package/build/capture/launch.js +7 -6
- package/build/cli.js +1 -1
- package/build/version.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3](https://github.com/browserless/browserless-cli/compare/v0.0.2...v0.0.3) (2026-06-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **capture:** connect to the browser CDP endpoint, not a default page target ([417cb12](https://github.com/browserless/browserless-cli/commit/417cb122743bfcfdd91ebbd4d010c7558f02138c))
|
|
9
|
+
* **capture:** retry the default-target CDP connect on "No inspectable targets" ([b834311](https://github.com/browserless/browserless-cli/commit/b8343118a801938e09ff4a5e67957762317a08b1))
|
|
10
|
+
* **capture:** wait for an inspectable target before connecting (fixes "No inspectable targets") ([69c2e96](https://github.com/browserless/browserless-cli/commit/69c2e961e6f70fba5fd40a6ea64e3aba9f323047))
|
|
11
|
+
* **cli:** set process.exitCode instead of process.exit() on error path ([2a6042a](https://github.com/browserless/browserless-cli/commit/2a6042a52fbdbedfcb56086566a6f0a4bdb09ea0))
|
|
12
|
+
* **cli:** windows/macos flaky tests ([559a10d](https://github.com/browserless/browserless-cli/commit/559a10d729251cca0ba1e891bffe13b8caf7b186))
|
|
13
|
+
|
|
3
14
|
## [0.0.2](https://github.com/browserless/browserless-cli/compare/v0.0.1...v0.0.2) (2026-05-27)
|
|
4
15
|
|
|
5
16
|
|
package/build/capture/launch.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
var w=Object.defineProperty;var
|
|
2
|
-
Browser process: pid=${
|
|
3
|
-
Launch command: ${
|
|
4
|
-
|
|
5
|
-
${
|
|
6
|
-
|
|
1
|
+
var w=Object.defineProperty;var a=(e,r)=>w(e,"name",{value:r,configurable:!0});import g from"node:net";import{spawn as b,spawnSync as m}from"node:child_process";import{resolveLinuxPasswordStore as C}from"../browsers/password-store.js";import{CaptureError as c}from"../errors.js";const y=a(e=>new Promise(r=>setTimeout(r,e)),"sleep"),D=a(()=>new Promise((e,r)=>{const t=g.createServer();t.unref(),t.on("error",r),t.listen(0,"127.0.0.1",()=>{const n=t.address();t.close(()=>{typeof n=="object"&&n?e(n.port):r(new Error("Could not pick a free port"))})})}),"pickFreePort"),B=a(async(e,r=Number(process.env.BROWSERLESS_CDP_WAIT_MS)||15e3,t)=>{const n=Date.now()+r;let s,d="<not fetched>";for(;Date.now()<n;){try{if((await fetch(`http://127.0.0.1:${e}/json/version`)).ok){const o=await fetch(`http://127.0.0.1:${e}/json/list`);if(o.ok){const p=await o.json();if(Array.isArray(p)&&p.some(f=>typeof f?.webSocketDebuggerUrl=="string"))return;d=JSON.stringify(p)}}}catch(i){s=i}await y(150)}let l="";if(t){const i=t.getProcessState(),o=t.getStderr().trim();l=`
|
|
2
|
+
Browser process: pid=${i.pid??"unspawned"} exitCode=${i.exitCode} signal=${i.signalCode}
|
|
3
|
+
Launch command: ${i.spawnfile} ${i.spawnargs.slice(1).join(" ")}
|
|
4
|
+
Last /json/list: ${d}`+(o?`
|
|
5
|
+
Browser stderr (last ${Math.min(o.length,2e3)} chars):
|
|
6
|
+
${o.slice(-2e3)}`:`
|
|
7
|
+
Browser stderr: <empty>`)}throw new c(`Browser CDP endpoint did not expose an inspectable target within ${r}ms (last error: ${String(s)})${l}`,"cdp-timeout")},"waitForDebuggerEndpoint"),k=["--disable-background-networking","--disable-component-update","--disable-sync","--disable-domain-reliability","--disable-datasaver-prompt","--no-pings","--no-service-autorun","--safebrowsing-disable-auto-update","--disable-external-intent-requests","--metrics-recording-only","--disable-background-timer-throttling","--disable-backgrounding-occluded-windows","--disable-renderer-backgrounding","--disable-back-forward-cache","--disable-ipc-flooding-protection","--disable-hang-monitor","--disable-popup-blocking","--disable-prompt-on-repost","--disable-search-engine-choice-screen","--disable-breakpad","--disable-client-side-phishing-detection","--disable-infobars","--disable-print-preview","--disable-desktop-notifications","--disable-speech-api","--disable-speech-synthesis-api","--suppress-message-center-popups","--noerrdialogs","--disable-blink-features=AutomationControlled","--disable-features="+["AcceptCHFrame","AutoExpandDetailsElement","AvoidUnnecessaryBeforeUnloadCheckSync","CertificateTransparencyComponentUpdater","DialMediaRouteProvider","GlobalMediaControls","HttpsUpgrades","ImprovedCookieControls","LazyFrameLoading","MediaRouter","PaintHolding","Translate","AutomationControlled","BackForwardCache","OptimizationHints","CalculateNativeWinOcclusion","AutofillServerCommunication","CrashReporting","OverscrollHistoryNavigation","InfiniteSessionRestore"].join(",")],P=a(async e=>{const r=e.headless??!0,t=[`--remote-debugging-port=${e.port}`,`--user-data-dir=${e.userDataDir}`,`--profile-directory=${e.profile.profileDirName}`,"--no-first-run","--no-default-browser-check"];r&&t.push("--headless=new","--disable-gpu",...k);let n=!1;if(process.platform==="linux"){const{store:o,defaulted:p}=await C(e.profile.userDataDir,e.passwordStoreOverride);t.push(`--password-store=${o}`),n=p}t.push("about:blank");const s=b(e.profile.binaryPath,t,{detached:!1,stdio:["ignore","pipe","pipe"]}),d=[];let l=0;const i=64*1024;return s.stdout?.on("data",()=>{}),s.stderr?.on("data",o=>{l>=i||(d.push(o),l+=o.length)}),{child:s,passwordStoreDefaulted:n,diagnostics:{getStderr:a(()=>Buffer.concat(d).toString("utf-8"),"getStderr"),getProcessState:a(()=>({pid:s.pid,exitCode:s.exitCode,signalCode:s.signalCode,spawnfile:s.spawnfile,spawnargs:s.spawnargs}),"getProcessState")}}},"launchBrowser"),A=a(async e=>{const r=await fetch(`http://127.0.0.1:${e}/json/version`);if(!r.ok)throw new c(`CDP /json/version returned ${r.status} ${r.statusText}`,"cdp-metadata-invalid");const t=await r.json();if(typeof t.webSocketDebuggerUrl!="string"||typeof t.Browser!="string")throw new c(`CDP /json/version returned an unexpected payload: ${JSON.stringify(t)}`,"cdp-metadata-invalid");return{Browser:t.Browser,webSocketDebuggerUrl:t.webSocketDebuggerUrl}},"fetchCdpMetadata"),u=a((e,r)=>new Promise(t=>{if(e.exitCode!==null||e.signalCode!==null){t();return}const n=setTimeout(t,r);e.once("exit",()=>{clearTimeout(n),t()})}),"waitExitOrTimeout"),T=a(async(e,r=2e3)=>{if(!(!e||e.killed)){if(process.platform==="win32"&&typeof e.pid=="number"){m("taskkill",["/pid",String(e.pid),"/T","/F"],{stdio:"ignore",windowsHide:!0}),await u(e,r);return}e.kill("SIGTERM"),await u(e,r),!e.killed&&e.exitCode===null&&(e.kill("SIGKILL"),await u(e,5e3)),e.stdin?.destroy(),e.stdout?.destroy(),e.stderr?.destroy(),e.unref()}},"killBrowser");export{A as fetchCdpMetadata,T as killBrowser,P as launchBrowser,D as pickFreePort,B as waitForDebuggerEndpoint};
|
package/build/cli.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
import{Command as e}from"commander";import{version as o}from"./version.js";import{registerProfile as i}from"./commands/profile/index.js";import{registerAuth as t}from"./commands/auth/index.js";import{registerConfig as n}from"./commands/config/index.js";import{exitCodeFor as m,UserFacingError as a}from"./errors.js";const s=new e;s.name("browserless").description("Browserless CLI \u2014 manage profiles, sessions, and more.").version(o),i(s),t(s),n(s),s.parseAsync(process.argv).catch(r=>{r instanceof a?process.stderr.write(`${r.message}
|
|
3
3
|
`):r instanceof Error?process.stderr.write(`${r.stack??r.message}
|
|
4
4
|
`):process.stderr.write(`${String(r)}
|
|
5
|
-
`),process.
|
|
5
|
+
`),process.exitCode=m(r)});
|
package/build/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="0.0.
|
|
1
|
+
const o="0.0.3";export{o as version};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@browserless.io/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Browserless CLI — manage authentication profiles, sessions, and other Browserless features from your terminal.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"chrome-remote-interface": "^0.34.0",
|
|
47
|
-
"commander": "^
|
|
47
|
+
"commander": "^15.0.0"
|
|
48
48
|
},
|
|
49
49
|
"optionalDependencies": {
|
|
50
50
|
"@napi-rs/keyring": "^1.3.0"
|
|
@@ -58,13 +58,13 @@
|
|
|
58
58
|
"@types/sinon": "^21.0.1",
|
|
59
59
|
"chai": "^6.2.2",
|
|
60
60
|
"esbuild": "^0.28.0",
|
|
61
|
-
"eslint": "^10.4.
|
|
61
|
+
"eslint": "^10.4.1",
|
|
62
62
|
"globals": "^17.6.0",
|
|
63
63
|
"mocha": "^11.7.6",
|
|
64
64
|
"prettier": "^3.8.3",
|
|
65
65
|
"sinon": "^22.0.0",
|
|
66
66
|
"typescript": "^6.0.3",
|
|
67
|
-
"typescript-eslint": "^8.60.
|
|
67
|
+
"typescript-eslint": "^8.60.1"
|
|
68
68
|
},
|
|
69
69
|
"overrides": {
|
|
70
70
|
"mocha": {
|