@letsscrapedata/controller 0.0.57 → 0.0.58
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/index.cjs +15 -2
- package/dist/index.d.cts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +15 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7900,10 +7900,23 @@ var LsdBrowserController = class _LsdBrowserController {
|
|
|
7900
7900
|
}
|
|
7901
7901
|
if (userDataDir) {
|
|
7902
7902
|
launchOptions.user_data_dir = userDataDir;
|
|
7903
|
+
launchOptions.persistent_context = true;
|
|
7903
7904
|
}
|
|
7904
7905
|
if (args.length > 0) {
|
|
7905
7906
|
launchOptions.args = args;
|
|
7906
7907
|
}
|
|
7908
|
+
if (typeof options.geoip === "boolean" || typeof options.geoip === "string") {
|
|
7909
|
+
launchOptions.geoip = options.geoip;
|
|
7910
|
+
actOptions.geoip = options.geoip;
|
|
7911
|
+
}
|
|
7912
|
+
if (typeof options.mainWorldEval === "boolean") {
|
|
7913
|
+
launchOptions.main_world_eval = options.mainWorldEval;
|
|
7914
|
+
actOptions.mainWorldEval = options.mainWorldEval;
|
|
7915
|
+
}
|
|
7916
|
+
if (Array.isArray(options.addons) && options.addons.length > 0 && options.addons.every((addon) => typeof addon === "string")) {
|
|
7917
|
+
launchOptions.addons = options.addons;
|
|
7918
|
+
actOptions.addons = options.addons;
|
|
7919
|
+
}
|
|
7907
7920
|
if (options.launchMethod === "launchServer") {
|
|
7908
7921
|
const browserServer = await (0, import_camoufox_js.launchServer)(launchOptions);
|
|
7909
7922
|
const process = browserServer.process();
|
|
@@ -7958,7 +7971,7 @@ var LsdBrowserController = class _LsdBrowserController {
|
|
|
7958
7971
|
const browser = await playwrightBrowserType.connectOverCDP(browserUrl);
|
|
7959
7972
|
const lsdBrowser = new PlaywrightBrowser(browser, browserType, "connect", actOptions, this.#nextBrowserIdx++, browserPid);
|
|
7960
7973
|
return lsdBrowser;
|
|
7961
|
-
} else if (browserControllerType === "patchright") {
|
|
7974
|
+
} else if (browserControllerType === "patchright" || browserControllerType === "camoufox") {
|
|
7962
7975
|
const patchrightBrowserType = this.#patchrightBrowserType(browserType, true);
|
|
7963
7976
|
const browser = await patchrightBrowserType.connectOverCDP(browserUrl);
|
|
7964
7977
|
const lsdBrowser = new PatchrightBrowser(browser, browserType, "connect", actOptions, this.#nextBrowserIdx++, browserPid);
|
|
@@ -7970,7 +7983,7 @@ var LsdBrowserController = class _LsdBrowserController {
|
|
|
7970
7983
|
;
|
|
7971
7984
|
return lsdBrowser;
|
|
7972
7985
|
} else {
|
|
7973
|
-
|
|
7986
|
+
(0, import_utils18.unreachable)(browserControllerType);
|
|
7974
7987
|
}
|
|
7975
7988
|
}
|
|
7976
7989
|
async newApiContext(options = {}) {
|
package/dist/index.d.cts
CHANGED
|
@@ -177,6 +177,25 @@ interface LsdLaunchOptions extends BrowserOptions {
|
|
|
177
177
|
* @default "launch"
|
|
178
178
|
*/
|
|
179
179
|
launchMethod?: BrowserLaunchMethod;
|
|
180
|
+
/**
|
|
181
|
+
* Calculates longitude, latitude, timezone, country, & locale based on the IP address. Pass the target IP address(string) to use, or true to find the IP address automatically.
|
|
182
|
+
** valid only in camfoufox: geoip
|
|
183
|
+
** please install Camoufox with the geoip extra
|
|
184
|
+
* @default false
|
|
185
|
+
*/
|
|
186
|
+
geoip?: boolean | string;
|
|
187
|
+
/**
|
|
188
|
+
* Whether to inject scripts into the main world when prefixed with mw.
|
|
189
|
+
** valid only in camfoufox: main_world_eval
|
|
190
|
+
* @default false
|
|
191
|
+
*/
|
|
192
|
+
mainWorldEval?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* List of Firefox addons to use. Must be paths to extracted addons.
|
|
195
|
+
** valid only in camfoufox: addons
|
|
196
|
+
* @default []
|
|
197
|
+
*/
|
|
198
|
+
addons?: string[];
|
|
180
199
|
}
|
|
181
200
|
interface LsdConnectOptions extends BrowserOptions {
|
|
182
201
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -177,6 +177,25 @@ interface LsdLaunchOptions extends BrowserOptions {
|
|
|
177
177
|
* @default "launch"
|
|
178
178
|
*/
|
|
179
179
|
launchMethod?: BrowserLaunchMethod;
|
|
180
|
+
/**
|
|
181
|
+
* Calculates longitude, latitude, timezone, country, & locale based on the IP address. Pass the target IP address(string) to use, or true to find the IP address automatically.
|
|
182
|
+
** valid only in camfoufox: geoip
|
|
183
|
+
** please install Camoufox with the geoip extra
|
|
184
|
+
* @default false
|
|
185
|
+
*/
|
|
186
|
+
geoip?: boolean | string;
|
|
187
|
+
/**
|
|
188
|
+
* Whether to inject scripts into the main world when prefixed with mw.
|
|
189
|
+
** valid only in camfoufox: main_world_eval
|
|
190
|
+
* @default false
|
|
191
|
+
*/
|
|
192
|
+
mainWorldEval?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* List of Firefox addons to use. Must be paths to extracted addons.
|
|
195
|
+
** valid only in camfoufox: addons
|
|
196
|
+
* @default []
|
|
197
|
+
*/
|
|
198
|
+
addons?: string[];
|
|
180
199
|
}
|
|
181
200
|
interface LsdConnectOptions extends BrowserOptions {
|
|
182
201
|
/**
|
package/dist/index.js
CHANGED
|
@@ -7853,10 +7853,23 @@ var LsdBrowserController = class _LsdBrowserController {
|
|
|
7853
7853
|
}
|
|
7854
7854
|
if (userDataDir) {
|
|
7855
7855
|
launchOptions.user_data_dir = userDataDir;
|
|
7856
|
+
launchOptions.persistent_context = true;
|
|
7856
7857
|
}
|
|
7857
7858
|
if (args.length > 0) {
|
|
7858
7859
|
launchOptions.args = args;
|
|
7859
7860
|
}
|
|
7861
|
+
if (typeof options.geoip === "boolean" || typeof options.geoip === "string") {
|
|
7862
|
+
launchOptions.geoip = options.geoip;
|
|
7863
|
+
actOptions.geoip = options.geoip;
|
|
7864
|
+
}
|
|
7865
|
+
if (typeof options.mainWorldEval === "boolean") {
|
|
7866
|
+
launchOptions.main_world_eval = options.mainWorldEval;
|
|
7867
|
+
actOptions.mainWorldEval = options.mainWorldEval;
|
|
7868
|
+
}
|
|
7869
|
+
if (Array.isArray(options.addons) && options.addons.length > 0 && options.addons.every((addon) => typeof addon === "string")) {
|
|
7870
|
+
launchOptions.addons = options.addons;
|
|
7871
|
+
actOptions.addons = options.addons;
|
|
7872
|
+
}
|
|
7860
7873
|
if (options.launchMethod === "launchServer") {
|
|
7861
7874
|
const browserServer = await launchServer(launchOptions);
|
|
7862
7875
|
const process = browserServer.process();
|
|
@@ -7911,7 +7924,7 @@ var LsdBrowserController = class _LsdBrowserController {
|
|
|
7911
7924
|
const browser = await playwrightBrowserType.connectOverCDP(browserUrl);
|
|
7912
7925
|
const lsdBrowser = new PlaywrightBrowser(browser, browserType, "connect", actOptions, this.#nextBrowserIdx++, browserPid);
|
|
7913
7926
|
return lsdBrowser;
|
|
7914
|
-
} else if (browserControllerType === "patchright") {
|
|
7927
|
+
} else if (browserControllerType === "patchright" || browserControllerType === "camoufox") {
|
|
7915
7928
|
const patchrightBrowserType = this.#patchrightBrowserType(browserType, true);
|
|
7916
7929
|
const browser = await patchrightBrowserType.connectOverCDP(browserUrl);
|
|
7917
7930
|
const lsdBrowser = new PatchrightBrowser(browser, browserType, "connect", actOptions, this.#nextBrowserIdx++, browserPid);
|
|
@@ -7923,7 +7936,7 @@ var LsdBrowserController = class _LsdBrowserController {
|
|
|
7923
7936
|
;
|
|
7924
7937
|
return lsdBrowser;
|
|
7925
7938
|
} else {
|
|
7926
|
-
|
|
7939
|
+
unreachable9(browserControllerType);
|
|
7927
7940
|
}
|
|
7928
7941
|
}
|
|
7929
7942
|
async newApiContext(options = {}) {
|
package/package.json
CHANGED