@crawlee/browser 4.0.0-beta.86 → 4.0.0-beta.87
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.
|
@@ -69,7 +69,7 @@ export interface BrowserLaunchContext<TOptions, Launcher> extends BrowserPluginO
|
|
|
69
69
|
* @ignore
|
|
70
70
|
*/
|
|
71
71
|
export declare abstract class BrowserLauncher<Plugin extends BrowserPlugin, Launcher = Plugin['library'], T extends Constructor<Plugin> = Constructor<Plugin>, LaunchOptions extends Dictionary<any> | undefined = Partial<Parameters<Plugin['launch']>[0]>, LaunchResult extends ReturnType<Plugin['launch']> = ReturnType<Plugin['launch']>> {
|
|
72
|
-
readonly
|
|
72
|
+
readonly configuration: Configuration;
|
|
73
73
|
launcher: Launcher;
|
|
74
74
|
proxyUrl?: string;
|
|
75
75
|
useChrome?: boolean;
|
|
@@ -99,7 +99,7 @@ export declare abstract class BrowserLauncher<Plugin extends BrowserPlugin, Laun
|
|
|
99
99
|
/**
|
|
100
100
|
* All `BrowserLauncher` parameters are passed via an launchContext object.
|
|
101
101
|
*/
|
|
102
|
-
constructor(launchContext: BrowserLaunchContext<LaunchOptions, Launcher>,
|
|
102
|
+
constructor(launchContext: BrowserLaunchContext<LaunchOptions, Launcher>, configuration?: Configuration);
|
|
103
103
|
/**
|
|
104
104
|
* @ignore
|
|
105
105
|
*/
|
|
@@ -13,7 +13,7 @@ const require = createRequire(import.meta.url);
|
|
|
13
13
|
* @ignore
|
|
14
14
|
*/
|
|
15
15
|
export class BrowserLauncher {
|
|
16
|
-
|
|
16
|
+
configuration;
|
|
17
17
|
launcher;
|
|
18
18
|
proxyUrl;
|
|
19
19
|
useChrome;
|
|
@@ -51,8 +51,8 @@ export class BrowserLauncher {
|
|
|
51
51
|
/**
|
|
52
52
|
* All `BrowserLauncher` parameters are passed via an launchContext object.
|
|
53
53
|
*/
|
|
54
|
-
constructor(launchContext,
|
|
55
|
-
this.
|
|
54
|
+
constructor(launchContext, configuration = Configuration.getGlobalConfiguration()) {
|
|
55
|
+
this.configuration = configuration;
|
|
56
56
|
const { launcher, proxyUrl, useChrome, userAgent, launchOptions = {}, ...otherLaunchContextProps } = launchContext;
|
|
57
57
|
this.validateProxyUrlProtocol(proxyUrl);
|
|
58
58
|
// those need to be reassigned otherwise they are {} in types
|
|
@@ -88,7 +88,7 @@ export class BrowserLauncher {
|
|
|
88
88
|
defaultViewport: DEFAULT_VIEWPORT,
|
|
89
89
|
...this.launchOptions,
|
|
90
90
|
};
|
|
91
|
-
if (this.
|
|
91
|
+
if (this.configuration.disableBrowserSandbox) {
|
|
92
92
|
launchOptions.args.push('--no-sandbox');
|
|
93
93
|
}
|
|
94
94
|
if (this.userAgent) {
|
|
@@ -103,10 +103,10 @@ export class BrowserLauncher {
|
|
|
103
103
|
return launchOptions;
|
|
104
104
|
}
|
|
105
105
|
getDefaultHeadlessOption() {
|
|
106
|
-
return this.
|
|
106
|
+
return this.configuration.headless && !this.configuration.xvfb;
|
|
107
107
|
}
|
|
108
108
|
getChromeExecutablePath() {
|
|
109
|
-
return this.
|
|
109
|
+
return this.configuration.chromeExecutablePath ?? this.getTypicalChromeExecutablePath();
|
|
110
110
|
}
|
|
111
111
|
/**
|
|
112
112
|
* Gets a typical path to Chrome executable, depending on the current operating system.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/browser",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.87",
|
|
4
4
|
"description": "The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.0.0"
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@apify/timeout": "^0.3.2",
|
|
51
|
-
"@crawlee/basic": "4.0.0-beta.
|
|
52
|
-
"@crawlee/browser-pool": "4.0.0-beta.
|
|
53
|
-
"@crawlee/types": "4.0.0-beta.
|
|
54
|
-
"@crawlee/utils": "4.0.0-beta.
|
|
51
|
+
"@crawlee/basic": "4.0.0-beta.87",
|
|
52
|
+
"@crawlee/browser-pool": "4.0.0-beta.87",
|
|
53
|
+
"@crawlee/types": "4.0.0-beta.87",
|
|
54
|
+
"@crawlee/utils": "4.0.0-beta.87",
|
|
55
55
|
"ow": "^2.0.0",
|
|
56
56
|
"tslib": "^2.8.1",
|
|
57
57
|
"type-fest": "^4.41.0"
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "1b7604cd77b694460aac4448b4555444fa1b2bdb"
|
|
79
79
|
}
|