@letsscrapedata/controller 0.0.27 → 0.0.28
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 +16 -2
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +17 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -17232,9 +17232,23 @@ var LsdBrowserController = class _LsdBrowserController {
|
|
|
17232
17232
|
}
|
|
17233
17233
|
setPuppeteerNode(puppeteer2) {
|
|
17234
17234
|
this.#puppeteer = puppeteer2;
|
|
17235
|
+
return true;
|
|
17235
17236
|
}
|
|
17236
|
-
|
|
17237
|
-
|
|
17237
|
+
setPlaywrightBrowserType(browserType, playwrightBrowserType) {
|
|
17238
|
+
switch (browserType) {
|
|
17239
|
+
case "chromium":
|
|
17240
|
+
this.#playwrightBrowserTypes.chromium = playwrightBrowserType;
|
|
17241
|
+
break;
|
|
17242
|
+
case "firefox":
|
|
17243
|
+
this.#playwrightBrowserTypes.firefox = playwrightBrowserType;
|
|
17244
|
+
break;
|
|
17245
|
+
case "webkit":
|
|
17246
|
+
this.#playwrightBrowserTypes.webkit = playwrightBrowserType;
|
|
17247
|
+
break;
|
|
17248
|
+
default:
|
|
17249
|
+
(0, import_utils15.unreachable)(browserType);
|
|
17250
|
+
}
|
|
17251
|
+
return true;
|
|
17238
17252
|
}
|
|
17239
17253
|
async launch(browserControllerType, browserType, options) {
|
|
17240
17254
|
let {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import EventEmitter from 'node:events';
|
|
2
|
-
import { Browser as Browser$1, BrowserContext as BrowserContext$1, Frame as Frame$1, Page as Page$1, HTTPResponse,
|
|
2
|
+
import { Browser as Browser$1, BrowserContext as BrowserContext$1, Frame as Frame$1, Page as Page$1, HTTPResponse, PuppeteerNode, ElementHandle } from 'puppeteer';
|
|
3
3
|
import { Browser, BrowserContext, Frame, Page, Response, BrowserType, Locator } from 'playwright';
|
|
4
4
|
import * as cheerio from 'cheerio';
|
|
5
5
|
|
|
@@ -938,6 +938,8 @@ interface LsdBrowser extends EventEmitter {
|
|
|
938
938
|
interface LsdBrowserController$1 {
|
|
939
939
|
launch(browserControllerType: BrowserControllerType, browserType: LsdBrowserType, options?: LsdLaunchOptions): Promise<LsdBrowser>;
|
|
940
940
|
connect(browserControllerType: BrowserControllerType, browserType: LsdBrowserType, options?: LsdConnectOptions): Promise<LsdBrowser>;
|
|
941
|
+
setPuppeteerNode(puppeteer: PuppeteerNode): boolean;
|
|
942
|
+
setPlaywrightBrowserType(browserType: LsdBrowserType, playwrightBrowserType: BrowserType): boolean;
|
|
941
943
|
}
|
|
942
944
|
/**
|
|
943
945
|
* globObj.cfg.XXX:
|
|
@@ -1263,8 +1265,8 @@ declare class CheerioElement implements LsdElement {
|
|
|
1263
1265
|
declare class LsdBrowserController implements LsdBrowserController$1 {
|
|
1264
1266
|
#private;
|
|
1265
1267
|
constructor();
|
|
1266
|
-
setPuppeteerNode(puppeteer: PuppeteerNode):
|
|
1267
|
-
|
|
1268
|
+
setPuppeteerNode(puppeteer: PuppeteerNode): boolean;
|
|
1269
|
+
setPlaywrightBrowserType(browserType: LsdBrowserType, playwrightBrowserType: BrowserType): boolean;
|
|
1268
1270
|
launch(browserControllerType: BrowserControllerType, browserType: LsdBrowserType, options: LsdLaunchOptions): Promise<LsdBrowser>;
|
|
1269
1271
|
connect(browserControllerType: BrowserControllerType, browserType: LsdBrowserType, options: LsdConnectOptions): Promise<LsdBrowser>;
|
|
1270
1272
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import EventEmitter from 'node:events';
|
|
2
|
-
import { Browser as Browser$1, BrowserContext as BrowserContext$1, Frame as Frame$1, Page as Page$1, HTTPResponse,
|
|
2
|
+
import { Browser as Browser$1, BrowserContext as BrowserContext$1, Frame as Frame$1, Page as Page$1, HTTPResponse, PuppeteerNode, ElementHandle } from 'puppeteer';
|
|
3
3
|
import { Browser, BrowserContext, Frame, Page, Response, BrowserType, Locator } from 'playwright';
|
|
4
4
|
import * as cheerio from 'cheerio';
|
|
5
5
|
|
|
@@ -938,6 +938,8 @@ interface LsdBrowser extends EventEmitter {
|
|
|
938
938
|
interface LsdBrowserController$1 {
|
|
939
939
|
launch(browserControllerType: BrowserControllerType, browserType: LsdBrowserType, options?: LsdLaunchOptions): Promise<LsdBrowser>;
|
|
940
940
|
connect(browserControllerType: BrowserControllerType, browserType: LsdBrowserType, options?: LsdConnectOptions): Promise<LsdBrowser>;
|
|
941
|
+
setPuppeteerNode(puppeteer: PuppeteerNode): boolean;
|
|
942
|
+
setPlaywrightBrowserType(browserType: LsdBrowserType, playwrightBrowserType: BrowserType): boolean;
|
|
941
943
|
}
|
|
942
944
|
/**
|
|
943
945
|
* globObj.cfg.XXX:
|
|
@@ -1263,8 +1265,8 @@ declare class CheerioElement implements LsdElement {
|
|
|
1263
1265
|
declare class LsdBrowserController implements LsdBrowserController$1 {
|
|
1264
1266
|
#private;
|
|
1265
1267
|
constructor();
|
|
1266
|
-
setPuppeteerNode(puppeteer: PuppeteerNode):
|
|
1267
|
-
|
|
1268
|
+
setPuppeteerNode(puppeteer: PuppeteerNode): boolean;
|
|
1269
|
+
setPlaywrightBrowserType(browserType: LsdBrowserType, playwrightBrowserType: BrowserType): boolean;
|
|
1268
1270
|
launch(browserControllerType: BrowserControllerType, browserType: LsdBrowserType, options: LsdLaunchOptions): Promise<LsdBrowser>;
|
|
1269
1271
|
connect(browserControllerType: BrowserControllerType, browserType: LsdBrowserType, options: LsdConnectOptions): Promise<LsdBrowser>;
|
|
1270
1272
|
}
|
package/dist/index.js
CHANGED
|
@@ -17169,7 +17169,7 @@ var CheerioPage = class extends EventEmitter7 {
|
|
|
17169
17169
|
import os from "os";
|
|
17170
17170
|
import puppeteer from "puppeteer";
|
|
17171
17171
|
import playwright from "playwright";
|
|
17172
|
-
import { logwarn as logwarn6 } from "@letsscrapedata/utils";
|
|
17172
|
+
import { logwarn as logwarn6, unreachable as unreachable5 } from "@letsscrapedata/utils";
|
|
17173
17173
|
var LsdBrowserController = class _LsdBrowserController {
|
|
17174
17174
|
static #forbidConstructor = false;
|
|
17175
17175
|
#puppeteer;
|
|
@@ -17212,9 +17212,23 @@ var LsdBrowserController = class _LsdBrowserController {
|
|
|
17212
17212
|
}
|
|
17213
17213
|
setPuppeteerNode(puppeteer2) {
|
|
17214
17214
|
this.#puppeteer = puppeteer2;
|
|
17215
|
+
return true;
|
|
17215
17216
|
}
|
|
17216
|
-
|
|
17217
|
-
|
|
17217
|
+
setPlaywrightBrowserType(browserType, playwrightBrowserType) {
|
|
17218
|
+
switch (browserType) {
|
|
17219
|
+
case "chromium":
|
|
17220
|
+
this.#playwrightBrowserTypes.chromium = playwrightBrowserType;
|
|
17221
|
+
break;
|
|
17222
|
+
case "firefox":
|
|
17223
|
+
this.#playwrightBrowserTypes.firefox = playwrightBrowserType;
|
|
17224
|
+
break;
|
|
17225
|
+
case "webkit":
|
|
17226
|
+
this.#playwrightBrowserTypes.webkit = playwrightBrowserType;
|
|
17227
|
+
break;
|
|
17228
|
+
default:
|
|
17229
|
+
unreachable5(browserType);
|
|
17230
|
+
}
|
|
17231
|
+
return true;
|
|
17218
17232
|
}
|
|
17219
17233
|
async launch(browserControllerType, browserType, options) {
|
|
17220
17234
|
let {
|
package/package.json
CHANGED