browser-commander 0.13.0 → 0.14.0

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d22b80e: Add the `launchRealBrowser()` API name for launching and attaching to a genuine installed Chrome-family browser.
8
+
3
9
  ## 0.13.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -118,16 +118,16 @@ const { browser, page } = await connectBrowser({
118
118
  const commander = makeBrowserCommander({ page });
119
119
  ```
120
120
 
121
- `launchAndConnectRealBrowser()` can find and start a genuine installed Chrome,
121
+ `launchRealBrowser()` can find and start a genuine installed Chrome,
122
122
  Edge, Brave, or Chromium with a loopback CDP endpoint and then attach to it. It
123
123
  always uses a dedicated profile; Chrome 136 and newer do not honor remote
124
124
  debugging switches for the default profile. See the
125
125
  [Chrome remote-debugging security change](https://developer.chrome.com/blog/remote-debugging-port).
126
126
 
127
127
  ```javascript
128
- import { launchAndConnectRealBrowser } from 'browser-commander';
128
+ import { launchRealBrowser } from 'browser-commander';
129
129
 
130
- const connection = await launchAndConnectRealBrowser({
130
+ const connection = await launchRealBrowser({
131
131
  engine: 'puppeteer',
132
132
  channel: 'chrome',
133
133
  userDataDir: '/tmp/my-automation-profile',
@@ -140,6 +140,7 @@ await connection.browser.close();
140
140
 
141
141
  Cookie seeding copies only cookies you explicitly provide; the helper does not
142
142
  read, decrypt, or expose cookies from a browser's default profile.
143
+ `launchAndConnectRealBrowser()` remains available as a descriptive alias.
143
144
 
144
145
  Reuse a saved authenticated session by passing Playwright-compatible storage
145
146
  state as a JSON file path or object. Cookies and localStorage are restored for
@@ -359,7 +360,7 @@ const { browser, page } = await connectBrowser({
359
360
  Playwright accepts `timeout` and Puppeteer accepts `protocolTimeout`.
360
361
  `storageState` can also seed Playwright-compatible cookies and localStorage.
361
362
 
362
- ### launchAndConnectRealBrowser(options)
363
+ ### launchRealBrowser(options)
363
364
 
364
365
  Start an installed browser and connect through `connectBrowser()`. Use
365
366
  `channel` (`chrome`, `chrome-beta`, `chrome-dev`, `chrome-canary`, `msedge`,
@@ -369,6 +370,7 @@ a managed directory under `~/.browser-commander/real-browser/`, rejects known
369
370
  default browser-profile paths, protects its remote-debugging arguments, and
370
371
  returns the spawned `browserProcess`, resolved `cdpEndpoint`, executable path,
371
372
  and profile path alongside `{ browser, page }`.
373
+ `launchAndConnectRealBrowser()` is an alias with identical behavior.
372
374
 
373
375
  ### saveStorageState(page, filePath)
374
376
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser-commander",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Universal browser automation library that supports both Playwright and Puppeteer with a unified API",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -362,6 +362,15 @@ export async function launchAndConnectRealBrowser(options = {}) {
362
362
  return await launchAndConnectRealBrowserWithDependencies(options);
363
363
  }
364
364
 
365
+ /**
366
+ * Short Playwright-style name for {@link launchAndConnectRealBrowser}.
367
+ *
368
+ * Both names are the same function so existing callers can keep using the
369
+ * descriptive name while new code can use the API proposed for real-browser
370
+ * launch.
371
+ */
372
+ export const launchRealBrowser = launchAndConnectRealBrowser;
373
+
365
374
  /** Dependency-injected implementation used by the public helper and tests. */
366
375
  export async function launchAndConnectRealBrowserWithDependencies(
367
376
  options = {},
package/src/exports.js CHANGED
@@ -43,7 +43,10 @@ export {
43
43
 
44
44
  // Re-export browser management
45
45
  export { connectBrowser } from './browser/connector.js';
46
- export { launchAndConnectRealBrowser } from './browser/real-browser.js';
46
+ export {
47
+ launchAndConnectRealBrowser,
48
+ launchRealBrowser,
49
+ } from './browser/real-browser.js';
47
50
  export { launchBrowser } from './browser/launcher.js';
48
51
  export { saveStorageState } from './browser/storage-state.js';
49
52
  export { emulateMedia } from './browser/media.js';
@@ -9,8 +9,12 @@ import {
9
9
  buildRealBrowserArgs,
10
10
  launchAndConnectRealBrowser,
11
11
  launchAndConnectRealBrowserWithDependencies,
12
+ launchRealBrowser,
12
13
  } from '../../../src/browser/real-browser.js';
13
- import { launchAndConnectRealBrowser as publicHelper } from '../../../src/index.js';
14
+ import {
15
+ launchAndConnectRealBrowser as publicHelper,
16
+ launchRealBrowser as publicShortHelper,
17
+ } from '../../../src/index.js';
14
18
 
15
19
  describe('launchAndConnectRealBrowser', () => {
16
20
  let temporaryDirectory;
@@ -24,6 +28,8 @@ describe('launchAndConnectRealBrowser', () => {
24
28
 
25
29
  it('is exported from the package API', () => {
26
30
  assert.equal(publicHelper, launchAndConnectRealBrowser);
31
+ assert.equal(launchRealBrowser, launchAndConnectRealBrowser);
32
+ assert.equal(publicShortHelper, launchRealBrowser);
27
33
  });
28
34
 
29
35
  it('builds a loopback-only CDP command with a dedicated profile', () => {