@agent-infra/browser 0.1.1-beta.2 → 0.1.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/dist/base-browser.d.ts.map +1 -1
- package/dist/base-browser.js +36 -5
- package/dist/base-browser.js.map +1 -1
- package/dist/base-browser.mjs +32 -3
- package/dist/base-browser.mjs.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -21
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +0 -1
- package/dist/local-browser.d.ts.map +1 -1
- package/dist/local-browser.js +9 -8
- package/dist/local-browser.js.map +1 -1
- package/dist/local-browser.mjs +8 -9
- package/dist/local-browser.mjs.map +1 -1
- package/dist/remote-browser.d.ts +1 -0
- package/dist/remote-browser.d.ts.map +1 -1
- package/dist/remote-browser.js +10 -5
- package/dist/remote-browser.js.map +1 -1
- package/dist/remote-browser.mjs +9 -6
- package/dist/remote-browser.mjs.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -3
- package/dist/types.js.map +1 -0
- package/package.json +19 -14
- package/LICENSE +0 -201
- package/dist/browser-finder/chrome-paths.d.ts +0 -10
- package/dist/browser-finder/chrome-paths.d.ts.map +0 -1
- package/dist/browser-finder/chrome-paths.js +0 -160
- package/dist/browser-finder/chrome-paths.js.map +0 -1
- package/dist/browser-finder/chrome-paths.mjs +0 -118
- package/dist/browser-finder/chrome-paths.mjs.map +0 -1
- package/dist/browser-finder/firefox-paths.d.ts +0 -2
- package/dist/browser-finder/firefox-paths.d.ts.map +0 -1
- package/dist/browser-finder/firefox-paths.js +0 -132
- package/dist/browser-finder/firefox-paths.js.map +0 -1
- package/dist/browser-finder/firefox-paths.mjs +0 -90
- package/dist/browser-finder/firefox-paths.mjs.map +0 -1
- package/dist/browser-finder/index.d.ts +0 -15
- package/dist/browser-finder/index.d.ts.map +0 -1
- package/dist/browser-finder/index.js +0 -151
- package/dist/browser-finder/index.js.map +0 -1
- package/dist/browser-finder/index.mjs +0 -119
- package/dist/browser-finder/index.mjs.map +0 -1
- package/dist/browser-finder/index.test.d.ts +0 -2
- package/dist/browser-finder/index.test.d.ts.map +0 -1
package/dist/remote-browser.d.ts
CHANGED
|
@@ -44,5 +44,6 @@ export declare class RemoteBrowser extends BaseBrowser {
|
|
|
44
44
|
* @throws {Error} If connection to the remote browser fails
|
|
45
45
|
*/
|
|
46
46
|
launch(options?: LaunchOptions): Promise<void>;
|
|
47
|
+
setupPageListener(): Promise<void>;
|
|
47
48
|
}
|
|
48
49
|
//# sourceMappingURL=remote-browser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-browser.d.ts","sourceRoot":"","sources":["../src/remote-browser.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAKhC,OAAO,CAAC,OAAO,CAAC;IAJ5B;;;OAGG;gBACiB,OAAO,CAAC,EAAE,oBAAoB,YAAA;IAIlD;;;;;;OAMG;IACG,MAAM,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"remote-browser.d.ts","sourceRoot":"","sources":["../src/remote-browser.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAKhC,OAAO,CAAC,OAAO,CAAC;IAJ5B;;;OAGG;gBACiB,OAAO,CAAC,EAAE,oBAAoB,YAAA;IAIlD;;;;;;OAMG;IACG,MAAM,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IA8B9C,iBAAiB;CAGxB"}
|
package/dist/remote-browser.js
CHANGED
|
@@ -46,10 +46,10 @@ class RemoteBrowser extends external_base_browser_js_namespaceObject.BaseBrowser
|
|
|
46
46
|
async launch(options) {
|
|
47
47
|
var _this_options;
|
|
48
48
|
this.logger.info('Browser Launch options:', options);
|
|
49
|
-
let browserWSEndpoint = null
|
|
49
|
+
let browserWSEndpoint = null == (_this_options = this.options) ? void 0 : _this_options.wsEndpoint;
|
|
50
50
|
if (!browserWSEndpoint) {
|
|
51
51
|
var _this_options1;
|
|
52
|
-
const cdpEndpoint = (null
|
|
52
|
+
const cdpEndpoint = (null == (_this_options1 = this.options) ? void 0 : _this_options1.cdpEndpoint) || "http://127.0.0.1:9222/json/version";
|
|
53
53
|
const response = await fetch(cdpEndpoint);
|
|
54
54
|
const { webSocketDebuggerUrl } = await response.json();
|
|
55
55
|
browserWSEndpoint = webSocketDebuggerUrl;
|
|
@@ -71,13 +71,18 @@ class RemoteBrowser extends external_base_browser_js_namespaceObject.BaseBrowser
|
|
|
71
71
|
throw error;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
+
async setupPageListener() {
|
|
75
|
+
super.setupPageListener();
|
|
76
|
+
}
|
|
74
77
|
constructor(options){
|
|
75
78
|
super(options), _define_property(this, "options", void 0), this.options = options;
|
|
76
79
|
}
|
|
77
80
|
}
|
|
78
|
-
|
|
79
|
-
for(var __webpack_i__ in __webpack_exports__)
|
|
80
|
-
|
|
81
|
+
exports.RemoteBrowser = __webpack_exports__.RemoteBrowser;
|
|
82
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
83
|
+
"RemoteBrowser"
|
|
84
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
85
|
+
Object.defineProperty(exports, '__esModule', {
|
|
81
86
|
value: true
|
|
82
87
|
});
|
|
83
88
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-browser.js","sources":["webpack://@agent-infra/browser/./src/remote-browser.ts"],"sourcesContent":["/*\n * Copyright (c) 2025 Bytedance, Inc. and its affiliates.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport * as puppeteer from 'puppeteer-core';\nimport { BaseBrowser, BaseBrowserOptions } from './base-browser';\nimport { LaunchOptions } from './types';\n\n/**\n * Configuration options for RemoteBrowser\n * @extends BaseBrowserOptions\n * @interface RemoteBrowserOptions\n * @property {string} [wsEndpoint] - WebSocket endpoint URL for direct connection\n * @property {string} [cdpEndpoint] - Remote Chrome DevTools Protocol endpoint\n */\nexport interface RemoteBrowserOptions extends BaseBrowserOptions {\n wsEndpoint?: string;\n /** @default http://localhost:9222/json/version */\n cdpEndpoint?: string;\n}\n\n/**\n * RemoteBrowser class for connecting to remote browser instances\n *\n * Currently, this RemoteBrowser is not production ready,\n * mainly because it still relies on `puppeteer-core`,\n * which can only run on Node.js.\n *\n * At the same time, Chrome instances built with\n * `--remote-debugging-address` on Linux have security risks\n *\n * @see https://issues.chromium.org/issues/41487252\n * @see https://issues.chromium.org/issues/40261787\n * @see https://github.com/pyppeteer/pyppeteer/pull/379\n * @see https://stackoverflow.com/questions/72760355/chrome-remote-debugging-not-working-computer-to-computer\n *\n * @extends BaseBrowser\n */\nexport class RemoteBrowser extends BaseBrowser {\n /**\n * Creates a new RemoteBrowser instance\n * @param {RemoteBrowserOptions} [options] - Configuration options for remote browser connection\n */\n constructor(private options?: RemoteBrowserOptions) {\n super(options);\n }\n\n /**\n * Connects to a remote browser instance using WebSocket\n * If no WebSocket endpoint is provided, attempts to discover it using the DevTools Protocol\n * @param {LaunchOptions} [options] - Launch configuration options\n * @returns {Promise<void>} Promise that resolves when connected to the remote browser\n * @throws {Error} If connection to the remote browser fails\n */\n async launch(options?: LaunchOptions): Promise<void> {\n this.logger.info('Browser Launch options:', options);\n\n let browserWSEndpoint = this.options?.wsEndpoint;\n\n if (!browserWSEndpoint) {\n const cdpEndpoint =\n this.options?.cdpEndpoint || `http://127.0.0.1:9222/json/version`;\n const response = await fetch(cdpEndpoint);\n const { webSocketDebuggerUrl } = await response.json();\n browserWSEndpoint = webSocketDebuggerUrl;\n }\n\n this.logger.info('Using WebSocket endpoint:', browserWSEndpoint);\n\n const puppeteerConnectOptions: puppeteer.ConnectOptions = {\n browserWSEndpoint,\n defaultViewport: options?.defaultViewport ?? { width: 1280, height: 800 },\n };\n\n try {\n this.browser = await puppeteer.connect(puppeteerConnectOptions);\n await this.setupPageListener();\n this.logger.success('Connected to remote browser successfully');\n } catch (error) {\n this.logger.error('Failed to connect to remote browser:', error);\n throw error;\n }\n }\n}\n"],"names":["RemoteBrowser","BaseBrowser","options","_this_options","browserWSEndpoint","_this_options1","cdpEndpoint","response","fetch","webSocketDebuggerUrl","puppeteerConnectOptions","puppeteer","error"],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote-browser.js","sources":["webpack://@agent-infra/browser/webpack/runtime/define_property_getters","webpack://@agent-infra/browser/webpack/runtime/has_own_property","webpack://@agent-infra/browser/webpack/runtime/make_namespace_object","webpack://@agent-infra/browser/./src/remote-browser.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/*\n * Copyright (c) 2025 Bytedance, Inc. and its affiliates.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport * as puppeteer from 'puppeteer-core';\nimport { BaseBrowser, BaseBrowserOptions } from './base-browser';\nimport { LaunchOptions } from './types';\n\n/**\n * Configuration options for RemoteBrowser\n * @extends BaseBrowserOptions\n * @interface RemoteBrowserOptions\n * @property {string} [wsEndpoint] - WebSocket endpoint URL for direct connection\n * @property {string} [cdpEndpoint] - Remote Chrome DevTools Protocol endpoint\n */\nexport interface RemoteBrowserOptions extends BaseBrowserOptions {\n wsEndpoint?: string;\n /** @default http://localhost:9222/json/version */\n cdpEndpoint?: string;\n}\n\n/**\n * RemoteBrowser class for connecting to remote browser instances\n *\n * Currently, this RemoteBrowser is not production ready,\n * mainly because it still relies on `puppeteer-core`,\n * which can only run on Node.js.\n *\n * At the same time, Chrome instances built with\n * `--remote-debugging-address` on Linux have security risks\n *\n * @see https://issues.chromium.org/issues/41487252\n * @see https://issues.chromium.org/issues/40261787\n * @see https://github.com/pyppeteer/pyppeteer/pull/379\n * @see https://stackoverflow.com/questions/72760355/chrome-remote-debugging-not-working-computer-to-computer\n *\n * @extends BaseBrowser\n */\nexport class RemoteBrowser extends BaseBrowser {\n /**\n * Creates a new RemoteBrowser instance\n * @param {RemoteBrowserOptions} [options] - Configuration options for remote browser connection\n */\n constructor(private options?: RemoteBrowserOptions) {\n super(options);\n }\n\n /**\n * Connects to a remote browser instance using WebSocket\n * If no WebSocket endpoint is provided, attempts to discover it using the DevTools Protocol\n * @param {LaunchOptions} [options] - Launch configuration options\n * @returns {Promise<void>} Promise that resolves when connected to the remote browser\n * @throws {Error} If connection to the remote browser fails\n */\n async launch(options?: LaunchOptions): Promise<void> {\n this.logger.info('Browser Launch options:', options);\n\n let browserWSEndpoint = this.options?.wsEndpoint;\n\n if (!browserWSEndpoint) {\n const cdpEndpoint =\n this.options?.cdpEndpoint || `http://127.0.0.1:9222/json/version`;\n const response = await fetch(cdpEndpoint);\n const { webSocketDebuggerUrl } = await response.json();\n browserWSEndpoint = webSocketDebuggerUrl;\n }\n\n this.logger.info('Using WebSocket endpoint:', browserWSEndpoint);\n\n const puppeteerConnectOptions: puppeteer.ConnectOptions = {\n browserWSEndpoint,\n defaultViewport: options?.defaultViewport ?? { width: 1280, height: 800 },\n };\n\n try {\n this.browser = await puppeteer.connect(puppeteerConnectOptions);\n await this.setupPageListener();\n this.logger.success('Connected to remote browser successfully');\n } catch (error) {\n this.logger.error('Failed to connect to remote browser:', error);\n throw error;\n }\n }\n\n async setupPageListener() {\n super.setupPageListener();\n }\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","RemoteBrowser","BaseBrowser","options","_this_options","browserWSEndpoint","_this_options1","cdpEndpoint","response","fetch","webSocketDebuggerUrl","puppeteerConnectOptions","puppeteer","error"],"mappings":";;;;;;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,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.mjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) 2025 Bytedance, Inc. and its affiliates.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import { connect } from "puppeteer-core";
|
|
6
|
+
import { BaseBrowser } from "./base-browser.mjs";
|
|
7
7
|
function _define_property(obj, key, value) {
|
|
8
8
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
9
9
|
value: value,
|
|
@@ -14,14 +14,14 @@ function _define_property(obj, key, value) {
|
|
|
14
14
|
else obj[key] = value;
|
|
15
15
|
return obj;
|
|
16
16
|
}
|
|
17
|
-
class RemoteBrowser extends
|
|
17
|
+
class RemoteBrowser extends BaseBrowser {
|
|
18
18
|
async launch(options) {
|
|
19
19
|
var _this_options;
|
|
20
20
|
this.logger.info('Browser Launch options:', options);
|
|
21
|
-
let browserWSEndpoint = null
|
|
21
|
+
let browserWSEndpoint = null == (_this_options = this.options) ? void 0 : _this_options.wsEndpoint;
|
|
22
22
|
if (!browserWSEndpoint) {
|
|
23
23
|
var _this_options1;
|
|
24
|
-
const cdpEndpoint = (null
|
|
24
|
+
const cdpEndpoint = (null == (_this_options1 = this.options) ? void 0 : _this_options1.cdpEndpoint) || "http://127.0.0.1:9222/json/version";
|
|
25
25
|
const response = await fetch(cdpEndpoint);
|
|
26
26
|
const { webSocketDebuggerUrl } = await response.json();
|
|
27
27
|
browserWSEndpoint = webSocketDebuggerUrl;
|
|
@@ -35,7 +35,7 @@ class RemoteBrowser extends __WEBPACK_EXTERNAL_MODULE__base_browser_mjs_64d751a3
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
try {
|
|
38
|
-
this.browser = await
|
|
38
|
+
this.browser = await connect(puppeteerConnectOptions);
|
|
39
39
|
await this.setupPageListener();
|
|
40
40
|
this.logger.success('Connected to remote browser successfully');
|
|
41
41
|
} catch (error) {
|
|
@@ -43,6 +43,9 @@ class RemoteBrowser extends __WEBPACK_EXTERNAL_MODULE__base_browser_mjs_64d751a3
|
|
|
43
43
|
throw error;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
+
async setupPageListener() {
|
|
47
|
+
super.setupPageListener();
|
|
48
|
+
}
|
|
46
49
|
constructor(options){
|
|
47
50
|
super(options), _define_property(this, "options", void 0), this.options = options;
|
|
48
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-browser.mjs","sources":["webpack://@agent-infra/browser/./src/remote-browser.ts"],"sourcesContent":["/*\n * Copyright (c) 2025 Bytedance, Inc. and its affiliates.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport * as puppeteer from 'puppeteer-core';\nimport { BaseBrowser, BaseBrowserOptions } from './base-browser';\nimport { LaunchOptions } from './types';\n\n/**\n * Configuration options for RemoteBrowser\n * @extends BaseBrowserOptions\n * @interface RemoteBrowserOptions\n * @property {string} [wsEndpoint] - WebSocket endpoint URL for direct connection\n * @property {string} [cdpEndpoint] - Remote Chrome DevTools Protocol endpoint\n */\nexport interface RemoteBrowserOptions extends BaseBrowserOptions {\n wsEndpoint?: string;\n /** @default http://localhost:9222/json/version */\n cdpEndpoint?: string;\n}\n\n/**\n * RemoteBrowser class for connecting to remote browser instances\n *\n * Currently, this RemoteBrowser is not production ready,\n * mainly because it still relies on `puppeteer-core`,\n * which can only run on Node.js.\n *\n * At the same time, Chrome instances built with\n * `--remote-debugging-address` on Linux have security risks\n *\n * @see https://issues.chromium.org/issues/41487252\n * @see https://issues.chromium.org/issues/40261787\n * @see https://github.com/pyppeteer/pyppeteer/pull/379\n * @see https://stackoverflow.com/questions/72760355/chrome-remote-debugging-not-working-computer-to-computer\n *\n * @extends BaseBrowser\n */\nexport class RemoteBrowser extends BaseBrowser {\n /**\n * Creates a new RemoteBrowser instance\n * @param {RemoteBrowserOptions} [options] - Configuration options for remote browser connection\n */\n constructor(private options?: RemoteBrowserOptions) {\n super(options);\n }\n\n /**\n * Connects to a remote browser instance using WebSocket\n * If no WebSocket endpoint is provided, attempts to discover it using the DevTools Protocol\n * @param {LaunchOptions} [options] - Launch configuration options\n * @returns {Promise<void>} Promise that resolves when connected to the remote browser\n * @throws {Error} If connection to the remote browser fails\n */\n async launch(options?: LaunchOptions): Promise<void> {\n this.logger.info('Browser Launch options:', options);\n\n let browserWSEndpoint = this.options?.wsEndpoint;\n\n if (!browserWSEndpoint) {\n const cdpEndpoint =\n this.options?.cdpEndpoint || `http://127.0.0.1:9222/json/version`;\n const response = await fetch(cdpEndpoint);\n const { webSocketDebuggerUrl } = await response.json();\n browserWSEndpoint = webSocketDebuggerUrl;\n }\n\n this.logger.info('Using WebSocket endpoint:', browserWSEndpoint);\n\n const puppeteerConnectOptions: puppeteer.ConnectOptions = {\n browserWSEndpoint,\n defaultViewport: options?.defaultViewport ?? { width: 1280, height: 800 },\n };\n\n try {\n this.browser = await puppeteer.connect(puppeteerConnectOptions);\n await this.setupPageListener();\n this.logger.success('Connected to remote browser successfully');\n } catch (error) {\n this.logger.error('Failed to connect to remote browser:', error);\n throw error;\n }\n }\n}\n"],"names":["RemoteBrowser","BaseBrowser","options","_this_options","browserWSEndpoint","_this_options1","cdpEndpoint","response","fetch","webSocketDebuggerUrl","puppeteerConnectOptions","puppeteer","error"],"mappings":";;;;;;AAGC;;;;;;;;;;AAmCM,MAAMA,sBAAsBC
|
|
1
|
+
{"version":3,"file":"remote-browser.mjs","sources":["webpack://@agent-infra/browser/./src/remote-browser.ts"],"sourcesContent":["/*\n * Copyright (c) 2025 Bytedance, Inc. and its affiliates.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport * as puppeteer from 'puppeteer-core';\nimport { BaseBrowser, BaseBrowserOptions } from './base-browser';\nimport { LaunchOptions } from './types';\n\n/**\n * Configuration options for RemoteBrowser\n * @extends BaseBrowserOptions\n * @interface RemoteBrowserOptions\n * @property {string} [wsEndpoint] - WebSocket endpoint URL for direct connection\n * @property {string} [cdpEndpoint] - Remote Chrome DevTools Protocol endpoint\n */\nexport interface RemoteBrowserOptions extends BaseBrowserOptions {\n wsEndpoint?: string;\n /** @default http://localhost:9222/json/version */\n cdpEndpoint?: string;\n}\n\n/**\n * RemoteBrowser class for connecting to remote browser instances\n *\n * Currently, this RemoteBrowser is not production ready,\n * mainly because it still relies on `puppeteer-core`,\n * which can only run on Node.js.\n *\n * At the same time, Chrome instances built with\n * `--remote-debugging-address` on Linux have security risks\n *\n * @see https://issues.chromium.org/issues/41487252\n * @see https://issues.chromium.org/issues/40261787\n * @see https://github.com/pyppeteer/pyppeteer/pull/379\n * @see https://stackoverflow.com/questions/72760355/chrome-remote-debugging-not-working-computer-to-computer\n *\n * @extends BaseBrowser\n */\nexport class RemoteBrowser extends BaseBrowser {\n /**\n * Creates a new RemoteBrowser instance\n * @param {RemoteBrowserOptions} [options] - Configuration options for remote browser connection\n */\n constructor(private options?: RemoteBrowserOptions) {\n super(options);\n }\n\n /**\n * Connects to a remote browser instance using WebSocket\n * If no WebSocket endpoint is provided, attempts to discover it using the DevTools Protocol\n * @param {LaunchOptions} [options] - Launch configuration options\n * @returns {Promise<void>} Promise that resolves when connected to the remote browser\n * @throws {Error} If connection to the remote browser fails\n */\n async launch(options?: LaunchOptions): Promise<void> {\n this.logger.info('Browser Launch options:', options);\n\n let browserWSEndpoint = this.options?.wsEndpoint;\n\n if (!browserWSEndpoint) {\n const cdpEndpoint =\n this.options?.cdpEndpoint || `http://127.0.0.1:9222/json/version`;\n const response = await fetch(cdpEndpoint);\n const { webSocketDebuggerUrl } = await response.json();\n browserWSEndpoint = webSocketDebuggerUrl;\n }\n\n this.logger.info('Using WebSocket endpoint:', browserWSEndpoint);\n\n const puppeteerConnectOptions: puppeteer.ConnectOptions = {\n browserWSEndpoint,\n defaultViewport: options?.defaultViewport ?? { width: 1280, height: 800 },\n };\n\n try {\n this.browser = await puppeteer.connect(puppeteerConnectOptions);\n await this.setupPageListener();\n this.logger.success('Connected to remote browser successfully');\n } catch (error) {\n this.logger.error('Failed to connect to remote browser:', error);\n throw error;\n }\n }\n\n async setupPageListener() {\n super.setupPageListener();\n }\n}\n"],"names":["RemoteBrowser","BaseBrowser","options","_this_options","browserWSEndpoint","_this_options1","cdpEndpoint","response","fetch","webSocketDebuggerUrl","puppeteerConnectOptions","puppeteer","error"],"mappings":";;;;;;AAGC;;;;;;;;;;AAmCM,MAAMA,sBAAsBC;IAgBjC,MAAM,OAAOC,OAAuB,EAAiB;YAG3BC;QAFxB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,2BAA2BD;QAE5C,IAAIE,oBAAoB,QAAAD,CAAAA,gBAAAA,IAAI,CAAC,OAAO,AAAD,IAAXA,KAAAA,IAAAA,cAAc,UAAU;QAEhD,IAAI,CAACC,mBAAmB;gBAEpBC;YADF,MAAMC,cACJD,AAAAA,SAAAA,CAAAA,iBAAAA,IAAI,CAAC,OAAO,AAAD,IAAXA,KAAAA,IAAAA,eAAc,WAAW,AAAD,KAAK;YAC/B,MAAME,WAAW,MAAMC,MAAMF;YAC7B,MAAM,EAAEG,oBAAoB,EAAE,GAAG,MAAMF,SAAS,IAAI;YACpDH,oBAAoBK;QACtB;QAEA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6BL;QAE9C,MAAMM,0BAAoD;YACxDN;YACA,iBAAiBF,AAAAA,CAAAA,QAAAA,UAAAA,KAAAA,IAAAA,QAAS,eAAe,AAAD,KAAK;gBAAE,OAAO;gBAAM,QAAQ;YAAI;QAC1E;QAEA,IAAI;YACF,IAAI,CAAC,OAAO,GAAG,MAAMS,QAAkBD;YACvC,MAAM,IAAI,CAAC,iBAAiB;YAC5B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;QACtB,EAAE,OAAOE,OAAO;YACd,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,wCAAwCA;YAC1D,MAAMA;QACR;IACF;IAEA,MAAM,oBAAoB;QACxB,KAAK,CAAC;IACR;IA3CA,YAAoBV,OAA8B,CAAE;QAClD,KAAK,CAACA,UAAAA,iBAAAA,IAAAA,EAAAA,WAAAA,KAAAA,IAAAA,IAAAA,CADYA,OAAO,GAAPA;IAEpB;AA0CF"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Page, KeyInput, WaitForOptions } from 'puppeteer-core';
|
|
2
|
-
|
|
2
|
+
import type { BrowserType } from '@agent-infra/browser-finder';
|
|
3
3
|
/**
|
|
4
4
|
* Options for launching a browser instance
|
|
5
5
|
* @interface LaunchOptions
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,eAAe,CAAC,EAAE;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,WAAW,CAAC,EA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AAwB,CAAC,CAAC,EAAE,CAAC,CAAC,GACtC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAErB;;;OAGG;IACH,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAChC;AAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -16,8 +16,9 @@ var __webpack_require__ = {};
|
|
|
16
16
|
})();
|
|
17
17
|
var __webpack_exports__ = {};
|
|
18
18
|
__webpack_require__.r(__webpack_exports__);
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
19
|
+
for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
20
|
+
Object.defineProperty(exports, '__esModule', {
|
|
22
21
|
value: true
|
|
23
22
|
});
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["webpack://@agent-infra/browser/webpack/runtime/make_namespace_object"],"sourcesContent":["// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};"],"names":["__webpack_require__","Symbol","Object"],"mappings":";;;;;;;IACAA,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOC,UAA0BA,OAAO,WAAW,EACrDC,OAAO,cAAc,CAAC,UAASD,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEC,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D"}
|
package/package.json
CHANGED
|
@@ -1,34 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-infra/browser",
|
|
3
3
|
"description": "A tiny Browser Control library, built for Agent Tars.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.3",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
10
11
|
"import": "./dist/index.mjs",
|
|
11
|
-
"require": "./dist/index.js"
|
|
12
|
-
"types": "./dist/index.d.ts"
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git@github.com:agent-infra/browser.git"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
18
25
|
"dependencies": {
|
|
19
|
-
"puppeteer-core": "24.
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"@agent-infra/
|
|
23
|
-
"@agent-infra/shared": "0.0.2-beta.0"
|
|
26
|
+
"puppeteer-core": "24.15.0",
|
|
27
|
+
"@agent-infra/logger": "0.0.2-beta.2",
|
|
28
|
+
"@agent-infra/shared": "0.0.2",
|
|
29
|
+
"@agent-infra/browser-finder": "0.1.3"
|
|
24
30
|
},
|
|
25
31
|
"devDependencies": {
|
|
26
|
-
"@types/
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"vitest": "3.
|
|
30
|
-
"@
|
|
31
|
-
"@rslib/core": "0.5.3"
|
|
32
|
+
"@types/node": "24.1.0",
|
|
33
|
+
"typescript": "5.8.3",
|
|
34
|
+
"vitest": "3.2.4",
|
|
35
|
+
"@vitest/coverage-v8": "3.2.4",
|
|
36
|
+
"@rslib/core": "0.11.0"
|
|
32
37
|
},
|
|
33
38
|
"scripts": {
|
|
34
39
|
"dev": "rslib build --watch",
|
package/LICENSE
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright [yyyy] [name of copyright owner]
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The following code is modified based on
|
|
3
|
-
* https://github.com/shirshak55/edge-paths/blob/master/index.ts
|
|
4
|
-
*
|
|
5
|
-
* MIT Licensed
|
|
6
|
-
* Copyright (c) 2020 Shirshak
|
|
7
|
-
* https://github.com/shirshak55/edge-paths/blob/master/LICENSE
|
|
8
|
-
*/
|
|
9
|
-
export declare function getAnyChromeStable(): string;
|
|
10
|
-
//# sourceMappingURL=chrome-paths.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chrome-paths.d.ts","sourceRoot":"","sources":["../../src/browser-finder/chrome-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAiJH,wBAAgB,kBAAkB,IAAI,MAAM,CAwB3C"}
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 Bytedance, Inc. and its affiliates.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
"use strict";
|
|
6
|
-
var __webpack_require__ = {};
|
|
7
|
-
(()=>{
|
|
8
|
-
__webpack_require__.n = (module)=>{
|
|
9
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
10
|
-
__webpack_require__.d(getter, {
|
|
11
|
-
a: getter
|
|
12
|
-
});
|
|
13
|
-
return getter;
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
(()=>{
|
|
17
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
18
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: definition[key]
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
(()=>{
|
|
25
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
26
|
-
})();
|
|
27
|
-
(()=>{
|
|
28
|
-
__webpack_require__.r = (exports1)=>{
|
|
29
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
30
|
-
value: 'Module'
|
|
31
|
-
});
|
|
32
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
33
|
-
value: true
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
})();
|
|
37
|
-
var __webpack_exports__ = {};
|
|
38
|
-
__webpack_require__.r(__webpack_exports__);
|
|
39
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
40
|
-
getAnyChromeStable: ()=>getAnyChromeStable
|
|
41
|
-
});
|
|
42
|
-
const external_fs_namespaceObject = require("fs");
|
|
43
|
-
const external_path_namespaceObject = require("path");
|
|
44
|
-
const external_which_namespaceObject = require("which");
|
|
45
|
-
var external_which_default = /*#__PURE__*/ __webpack_require__.n(external_which_namespaceObject);
|
|
46
|
-
const platform = process.platform;
|
|
47
|
-
function getChromeOnLinux(list) {
|
|
48
|
-
try {
|
|
49
|
-
for (const name of list){
|
|
50
|
-
const path = external_which_default().sync(name);
|
|
51
|
-
return path;
|
|
52
|
-
}
|
|
53
|
-
} catch (e) {}
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
function getChromeOnWindows(name) {
|
|
57
|
-
const suffix = `${external_path_namespaceObject.sep}Google${external_path_namespaceObject.sep}${name}${external_path_namespaceObject.sep}Application${external_path_namespaceObject.sep}chrome.exe`;
|
|
58
|
-
const prefixes = [
|
|
59
|
-
process.env.LOCALAPPDATA,
|
|
60
|
-
process.env.PROGRAMFILES,
|
|
61
|
-
process.env['PROGRAMFILES(X86)']
|
|
62
|
-
].filter(Boolean);
|
|
63
|
-
for (const prefix of prefixes){
|
|
64
|
-
const chrome = (0, external_path_namespaceObject.join)(prefix, suffix);
|
|
65
|
-
if ((0, external_fs_namespaceObject.existsSync)(chrome)) return chrome;
|
|
66
|
-
}
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
function getChromeOnDarwin(name) {
|
|
70
|
-
const suffix = `/Applications/${name}.app/Contents/MacOS/${name}`;
|
|
71
|
-
const prefixes = [
|
|
72
|
-
'',
|
|
73
|
-
process.env.HOME
|
|
74
|
-
].filter((item)=>void 0 !== item);
|
|
75
|
-
for (const prefix of prefixes){
|
|
76
|
-
const chromePath = (0, external_path_namespaceObject.join)(prefix, suffix);
|
|
77
|
-
if ((0, external_fs_namespaceObject.existsSync)(chromePath)) return chromePath;
|
|
78
|
-
}
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
const chromePaths = {
|
|
82
|
-
chrome: {
|
|
83
|
-
linux: ()=>getChromeOnLinux([
|
|
84
|
-
'google-chrome-stable',
|
|
85
|
-
'google-chrome'
|
|
86
|
-
]),
|
|
87
|
-
darwin: ()=>getChromeOnDarwin('Google Chrome'),
|
|
88
|
-
win32: ()=>getChromeOnWindows('Chrome')
|
|
89
|
-
},
|
|
90
|
-
beta: {
|
|
91
|
-
linux: ()=>getChromeOnLinux([
|
|
92
|
-
'google-chrome-beta'
|
|
93
|
-
]),
|
|
94
|
-
darwin: ()=>getChromeOnDarwin('Google Chrome Beta'),
|
|
95
|
-
win32: ()=>getChromeOnWindows('Chrome Beta')
|
|
96
|
-
},
|
|
97
|
-
dev: {
|
|
98
|
-
linux: ()=>getChromeOnLinux([
|
|
99
|
-
'google-chrome-dev'
|
|
100
|
-
]),
|
|
101
|
-
darwin: ()=>getChromeOnDarwin('Google Chrome Dev'),
|
|
102
|
-
win32: ()=>getChromeOnWindows('Chrome Dev')
|
|
103
|
-
},
|
|
104
|
-
canary: {
|
|
105
|
-
linux: ()=>getChromeOnLinux([
|
|
106
|
-
'chromium-browser',
|
|
107
|
-
'chromium'
|
|
108
|
-
]),
|
|
109
|
-
darwin: ()=>getChromeOnDarwin('Google Chrome Canary'),
|
|
110
|
-
win32: ()=>getChromeOnWindows('Chrome SxS')
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
function getChromePath() {
|
|
114
|
-
const chrome = chromePaths.chrome;
|
|
115
|
-
if (platform && Object.keys(chrome).includes(platform)) {
|
|
116
|
-
const pth = chrome[platform]();
|
|
117
|
-
if (pth) return pth;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
function getChromeBetaPath() {
|
|
121
|
-
const beta = chromePaths.beta;
|
|
122
|
-
if (platform && Object.keys(beta).includes(platform)) {
|
|
123
|
-
const pth = beta[platform]();
|
|
124
|
-
if (pth) return pth;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
function getChromeDevPath() {
|
|
128
|
-
const dev = chromePaths.dev;
|
|
129
|
-
if (platform && Object.keys(dev).includes(platform)) {
|
|
130
|
-
const pth = dev[platform]();
|
|
131
|
-
if (pth) return pth;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
function getChromeCanaryPath() {
|
|
135
|
-
const canary = chromePaths.canary;
|
|
136
|
-
if (platform && Object.keys(canary).includes(platform)) {
|
|
137
|
-
const pth = canary[platform]();
|
|
138
|
-
if (pth) return pth;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
function getAnyChromeStable() {
|
|
142
|
-
const chrome = getChromePath();
|
|
143
|
-
if (chrome) return chrome;
|
|
144
|
-
const beta = getChromeBetaPath();
|
|
145
|
-
if (beta) return beta;
|
|
146
|
-
const dev = getChromeDevPath();
|
|
147
|
-
if (dev) return dev;
|
|
148
|
-
const canary = getChromeCanaryPath();
|
|
149
|
-
if (canary) return canary;
|
|
150
|
-
const error = new Error('Unable to find any chrome browser.');
|
|
151
|
-
error.name = 'ChromePathsError';
|
|
152
|
-
throw error;
|
|
153
|
-
}
|
|
154
|
-
var __webpack_export_target__ = exports;
|
|
155
|
-
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
156
|
-
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
157
|
-
value: true
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
//# sourceMappingURL=chrome-paths.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser-finder/chrome-paths.js","sources":["webpack://@agent-infra/browser/./src/browser-finder/chrome-paths.ts"],"sourcesContent":["/**\n * The following code is modified based on\n * https://github.com/shirshak55/edge-paths/blob/master/index.ts\n *\n * MIT Licensed\n * Copyright (c) 2020 Shirshak\n * https://github.com/shirshak55/edge-paths/blob/master/LICENSE\n */\n\n/**\n * Q: Why not use [find-chrome-bin](https://github.com/mbalabash/find-chrome-bin) or [chrome-finder](https://github.com/gwuhaolin/chrome-finder)?\n *\n * A: The `find-chrome-bin` or `chrome-finder` libraries execute `lsregister -dump` under Darwin (macOS),\n * which is a time-consuming operation (taking up to 6 seconds on my computer!).\n * Since this process is performed during the app's startup, such a delay is unacceptable.\n */\nimport { existsSync } from 'fs';\nimport { sep, join } from 'path';\nimport which from 'which';\n\nconst platform = process.platform;\n\nfunction getChromeOnLinux(\n list: (\n | 'google-chrome'\n | 'google-chrome-stable'\n | 'google-chrome-beta'\n | 'google-chrome-dev'\n | 'chromium-browser'\n | 'chromium'\n )[],\n): string | null {\n // TODO: scan desktop installation folders, the `grep` operation can be somewhat time-consuming.\n // https://github.com/mbalabash/find-chrome-bin/blob/main/src/linux/index.js\n try {\n for (const name of list) {\n const path = which.sync(name);\n return path;\n }\n } catch (e) {}\n\n return null;\n}\n\nfunction getChromeOnWindows(\n name: 'Chrome' | 'Chrome Beta' | 'Chrome Dev' | 'Chrome SxS',\n): string | null {\n const suffix = `${sep}Google${sep}${name}${sep}Application${sep}chrome.exe`;\n\n const prefixes = [\n process.env.LOCALAPPDATA,\n process.env.PROGRAMFILES,\n process.env['PROGRAMFILES(X86)'],\n ].filter(Boolean);\n\n for (const prefix of prefixes) {\n const chrome = join(prefix!, suffix);\n if (existsSync(chrome)) {\n return chrome;\n }\n }\n\n return null;\n}\n\nfunction getChromeOnDarwin(\n name:\n | 'Google Chrome'\n | 'Google Chrome Beta'\n | 'Google Chrome Dev'\n | 'Google Chrome Canary',\n): string | null {\n const suffix = `/Applications/${name}.app/Contents/MacOS/${name}`;\n const prefixes = ['', process.env.HOME].filter((item) => item !== undefined);\n\n for (const prefix of prefixes) {\n const chromePath = join(prefix, suffix);\n if (existsSync(chromePath)) {\n return chromePath;\n }\n }\n\n return null;\n}\n\nconst chromePaths = {\n chrome: {\n linux: () => getChromeOnLinux(['google-chrome-stable', 'google-chrome']),\n darwin: () => getChromeOnDarwin('Google Chrome'),\n win32: () => getChromeOnWindows('Chrome'),\n },\n beta: {\n linux: () => getChromeOnLinux(['google-chrome-beta']),\n darwin: () => getChromeOnDarwin('Google Chrome Beta'),\n win32: () => getChromeOnWindows('Chrome Beta'),\n },\n dev: {\n linux: () => getChromeOnLinux(['google-chrome-dev']),\n darwin: () => getChromeOnDarwin('Google Chrome Dev'),\n win32: () => getChromeOnWindows('Chrome Dev'),\n },\n canary: {\n linux: () => getChromeOnLinux(['chromium-browser', 'chromium']),\n darwin: () => getChromeOnDarwin('Google Chrome Canary'),\n win32: () => getChromeOnWindows('Chrome SxS'),\n },\n};\n\nfunction getChromePath() {\n const chrome = chromePaths.chrome;\n\n if (platform && Object.keys(chrome).includes(platform)) {\n const pth = chrome[platform as keyof typeof chrome]();\n if (pth) {\n return pth;\n }\n }\n}\n\nfunction getChromeBetaPath() {\n const beta = chromePaths.beta;\n\n if (platform && Object.keys(beta).includes(platform)) {\n const pth = beta[platform as keyof typeof beta]();\n if (pth) {\n return pth;\n }\n }\n}\n\nfunction getChromeDevPath() {\n const dev = chromePaths.dev;\n\n if (platform && Object.keys(dev).includes(platform)) {\n const pth = dev[platform as keyof typeof dev]();\n if (pth) {\n return pth;\n }\n }\n}\n\nfunction getChromeCanaryPath() {\n const canary = chromePaths.canary;\n\n if (platform && Object.keys(canary).includes(platform)) {\n const pth = canary[platform as keyof typeof canary]();\n if (pth) {\n return pth;\n }\n }\n}\n\nexport function getAnyChromeStable(): string {\n const chrome = getChromePath();\n if (chrome) {\n return chrome;\n }\n\n const beta = getChromeBetaPath();\n if (beta) {\n return beta;\n }\n\n const dev = getChromeDevPath();\n if (dev) {\n return dev;\n }\n\n const canary = getChromeCanaryPath();\n if (canary) {\n return canary;\n }\n\n const error = new Error('Unable to find any chrome browser.');\n error.name = 'ChromePathsError';\n throw error;\n}\n"],"names":["platform","process","getChromeOnLinux","list","name","path","which","e","getChromeOnWindows","suffix","sep","prefixes","Boolean","prefix","chrome","join","existsSync","getChromeOnDarwin","item","undefined","chromePath","chromePaths","getChromePath","Object","pth","getChromeBetaPath","beta","getChromeDevPath","dev","getChromeCanaryPath","canary","getAnyChromeStable","error","Error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAMA,WAAWC,QAAQ,QAAQ;AAEjC,SAASC,iBACPC,IAOG;IAIH,IAAI;QACF,KAAK,MAAMC,QAAQD,KAAM;YACvB,MAAME,OAAOC,yBAAAA,IAAU,CAACF;YACxB,OAAOC;QACT;IACF,EAAE,OAAOE,GAAG,CAAC;IAEb,OAAO;AACT;AAEA,SAASC,mBACPJ,IAA4D;IAE5D,MAAMK,SAAS,GAAGC,8BAAAA,GAAGA,CAAC,MAAM,EAAEA,8BAAAA,GAAGA,GAAGN,OAAOM,8BAAAA,GAAGA,CAAC,WAAW,EAAEA,8BAAAA,GAA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