@letsscrapedata/controller 0.2.0 → 0.6.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/dist/index.cjs +221 -110
- package/dist/index.d.cts +41 -12
- package/dist/index.d.ts +41 -12
- package/dist/index.js +220 -110
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -159,6 +159,11 @@ interface BrowserOptions {
|
|
|
159
159
|
* @default 900
|
|
160
160
|
*/
|
|
161
161
|
maxPageFreeSeconds?: number;
|
|
162
|
+
/**
|
|
163
|
+
* maximum duration (in seconds) for which the idle page is reserved for tasks with the same domainName.
|
|
164
|
+
* @default 0, that means no reservation
|
|
165
|
+
*/
|
|
166
|
+
maxReservedSeconds?: number;
|
|
162
167
|
/**
|
|
163
168
|
* @default true
|
|
164
169
|
*/
|
|
@@ -284,6 +289,11 @@ type LsdBrowserContextOptions = {
|
|
|
284
289
|
* * puppeteer: set when creating the new page in the browserContext
|
|
285
290
|
*/
|
|
286
291
|
userAgent?: string;
|
|
292
|
+
/**
|
|
293
|
+
* maximum duration (in seconds) for which the idle page is reserved for tasks with the same domainName.
|
|
294
|
+
* @default 0, that means no reservation
|
|
295
|
+
*/
|
|
296
|
+
maxReservedSeconds?: number;
|
|
287
297
|
};
|
|
288
298
|
type PageStatus = "free" | "busy" | "closed";
|
|
289
299
|
/**
|
|
@@ -332,13 +342,14 @@ interface PageInfo {
|
|
|
332
342
|
* page's status: free or busy
|
|
333
343
|
* @default current unix time
|
|
334
344
|
*/
|
|
335
|
-
lastStatusUpdateTime: number;
|
|
336
345
|
/**
|
|
337
346
|
* taskId that are using this page
|
|
338
347
|
* @default 0
|
|
339
348
|
*/
|
|
340
349
|
taskId: number;
|
|
341
350
|
/**
|
|
351
|
+
** popup page: parentTaskId
|
|
352
|
+
** normal page@scraper: templateId
|
|
342
353
|
* @default 0
|
|
343
354
|
*/
|
|
344
355
|
relatedId: number;
|
|
@@ -352,7 +363,6 @@ interface UpdatablePageInfo {
|
|
|
352
363
|
* page's status: free or busy
|
|
353
364
|
* @default current unix time
|
|
354
365
|
*/
|
|
355
|
-
lastStatusUpdateTime?: number;
|
|
356
366
|
/**
|
|
357
367
|
* taskId that are using this page
|
|
358
368
|
* @default 0
|
|
@@ -982,6 +992,7 @@ interface WaitNavigationOptions {
|
|
|
982
992
|
*/
|
|
983
993
|
waitUntil?: NavigationWaitUntil;
|
|
984
994
|
}
|
|
995
|
+
declare const POPUP_TASK_ID = 7;
|
|
985
996
|
interface LsdPage extends EventEmitter {
|
|
986
997
|
/**
|
|
987
998
|
* Adds a script which would be evaluated in one of the following scenarios:
|
|
@@ -1087,7 +1098,14 @@ interface LsdPage extends EventEmitter {
|
|
|
1087
1098
|
*/
|
|
1088
1099
|
goto(url: string, options?: GotoOptions): Promise<boolean>;
|
|
1089
1100
|
id(): string;
|
|
1090
|
-
|
|
1101
|
+
/**
|
|
1102
|
+
* Is the current page free (available) for a new task for domainName?
|
|
1103
|
+
* @param domainName default "":
|
|
1104
|
+
** If it is "" and the current page URL is not "" / "about:blank", the current page must have been idle for maxReservedSeconds; otherwise, return false.
|
|
1105
|
+
** If it is not "", the current page URL must contain domainName; otherwise, return false.
|
|
1106
|
+
*/
|
|
1107
|
+
isAvailable(domainName?: string): boolean;
|
|
1108
|
+
lastStatusUpdateTime(): number;
|
|
1091
1109
|
/**
|
|
1092
1110
|
* valid only in CheerioPage
|
|
1093
1111
|
* @param html
|
|
@@ -1213,8 +1231,10 @@ interface LsdBrowserContext extends EventEmitter {
|
|
|
1213
1231
|
free(clearStateData?: boolean): boolean;
|
|
1214
1232
|
/**
|
|
1215
1233
|
* get a free page from current pages or by creating a new page
|
|
1234
|
+
* @param domainName default "", if it is not "", prioritize retrieving from a free page whose URL includes that value
|
|
1235
|
+
* @param always default false, whether a (new) page is always allocated, ignoring maxPagesPerBrowserContext
|
|
1216
1236
|
*/
|
|
1217
|
-
getPage(always?: boolean): Promise<LsdPage | null>;
|
|
1237
|
+
getPage(domainName?: string, always?: boolean): Promise<LsdPage | null>;
|
|
1218
1238
|
/**
|
|
1219
1239
|
* whether can get a number of free page(s)
|
|
1220
1240
|
* * refer to getPage()
|
|
@@ -1225,6 +1245,10 @@ interface LsdBrowserContext extends EventEmitter {
|
|
|
1225
1245
|
isFree(): boolean;
|
|
1226
1246
|
isIncognito(): boolean;
|
|
1227
1247
|
creationMethod(): BrowserContextCreationMethod;
|
|
1248
|
+
/**
|
|
1249
|
+
* get maximum duration (in seconds) for which the idle page is reserved for tasks with the same domainName.
|
|
1250
|
+
*/
|
|
1251
|
+
maxReservedSeconds(): number;
|
|
1228
1252
|
page(pageIdx: number): LsdPage | null;
|
|
1229
1253
|
pages(): LsdPage[];
|
|
1230
1254
|
proxy(): ProxyInController | null;
|
|
@@ -1347,19 +1371,20 @@ declare class PlaywrightBrowser extends EventEmitter implements LsdBrowser {
|
|
|
1347
1371
|
|
|
1348
1372
|
declare class PlaywrightBrowserContext extends EventEmitter implements LsdBrowserContext {
|
|
1349
1373
|
#private;
|
|
1350
|
-
constructor(lsdBrowser: LsdBrowser, browserContext: BrowserContext, browserContextCreationMethod: BrowserContextCreationMethod, incognito?: boolean, proxy?: ProxyInController | null, browserIdx?: number, browserContextIdx?: number, maxPagesPerBrowserContext?: number, maxPageFreeSeconds?: number, userAgent?: string, maxViewportOfNewPage?: boolean);
|
|
1374
|
+
constructor(lsdBrowser: LsdBrowser, browserContext: BrowserContext, browserContextCreationMethod: BrowserContextCreationMethod, incognito?: boolean, proxy?: ProxyInController | null, browserIdx?: number, browserContextIdx?: number, maxPagesPerBrowserContext?: number, maxPageFreeSeconds?: number, userAgent?: string, maxReservedSeconds?: number, maxViewportOfNewPage?: boolean);
|
|
1351
1375
|
apiContext(): LsdApiContext;
|
|
1352
1376
|
browser(): LsdBrowser;
|
|
1353
1377
|
close(): Promise<boolean>;
|
|
1354
1378
|
closeFreePages(maxPageFreeSeconds?: number): Promise<boolean>;
|
|
1355
1379
|
creationMethod(): BrowserContextCreationMethod;
|
|
1356
1380
|
doesMeetBrowserContextRequirements(browserContextRequirements: BrowserContextRequirements): boolean;
|
|
1357
|
-
getPage(always?: boolean): Promise<LsdPage | null>;
|
|
1381
|
+
getPage(domainName?: string, always?: boolean): Promise<LsdPage | null>;
|
|
1358
1382
|
free(clearStateData?: boolean): boolean;
|
|
1359
1383
|
hasFreePage(pageNum?: number): boolean;
|
|
1360
1384
|
id(): string;
|
|
1361
1385
|
isFree(): boolean;
|
|
1362
1386
|
isIncognito(): boolean;
|
|
1387
|
+
maxReservedSeconds(): number;
|
|
1363
1388
|
page(pageIdx: number): LsdPage | null;
|
|
1364
1389
|
pages(): LsdPage[];
|
|
1365
1390
|
proxy(): ProxyInController | null;
|
|
@@ -1395,7 +1420,8 @@ declare class PlaywrightPage extends EventEmitter implements LsdPage {
|
|
|
1395
1420
|
free(): Promise<boolean>;
|
|
1396
1421
|
goto(url: string, options?: GotoOptions | undefined): Promise<boolean>;
|
|
1397
1422
|
id(): string;
|
|
1398
|
-
|
|
1423
|
+
isAvailable(domainName?: string): boolean;
|
|
1424
|
+
lastStatusUpdateTime(): number;
|
|
1399
1425
|
localStroage(): Promise<LocalStorageOrigin[]>;
|
|
1400
1426
|
load(): boolean;
|
|
1401
1427
|
mainFrame(): AllFrame;
|
|
@@ -1497,19 +1523,20 @@ declare class PuppeteerBrowser extends EventEmitter implements LsdBrowser {
|
|
|
1497
1523
|
|
|
1498
1524
|
declare class PuppeteerBrowserContext extends EventEmitter implements LsdBrowserContext {
|
|
1499
1525
|
#private;
|
|
1500
|
-
constructor(lsdBrowser: LsdBrowser, browserContext: BrowserContext$1, browserContextCreationMethod: BrowserContextCreationMethod, incognito?: boolean, proxy?: ProxyInController | null, browserIdx?: number, browserContextIdx?: number, maxPagesPerBrowserContext?: number, maxPageFreeSeconds?: number, userAgent?: string, maxViewportOfNewPage?: boolean);
|
|
1526
|
+
constructor(lsdBrowser: LsdBrowser, browserContext: BrowserContext$1, browserContextCreationMethod: BrowserContextCreationMethod, incognito?: boolean, proxy?: ProxyInController | null, browserIdx?: number, browserContextIdx?: number, maxPagesPerBrowserContext?: number, maxPageFreeSeconds?: number, userAgent?: string, maxReservedSeconds?: number, maxViewportOfNewPage?: boolean);
|
|
1501
1527
|
apiContext(): LsdApiContext;
|
|
1502
1528
|
browser(): LsdBrowser;
|
|
1503
1529
|
close(): Promise<boolean>;
|
|
1504
1530
|
closeFreePages(maxPageFreeSeconds?: number): Promise<boolean>;
|
|
1505
1531
|
creationMethod(): BrowserContextCreationMethod;
|
|
1506
1532
|
doesMeetBrowserContextRequirements(browserContextRequirements: BrowserContextRequirements): boolean;
|
|
1507
|
-
getPage(always?: boolean): Promise<LsdPage | null>;
|
|
1533
|
+
getPage(domainName?: string, always?: boolean): Promise<LsdPage | null>;
|
|
1508
1534
|
free(clearStateData?: boolean): boolean;
|
|
1509
1535
|
hasFreePage(pageNum?: number): boolean;
|
|
1510
1536
|
id(): string;
|
|
1511
1537
|
isIncognito(): boolean;
|
|
1512
1538
|
isFree(): boolean;
|
|
1539
|
+
maxReservedSeconds(): number;
|
|
1513
1540
|
page(pageIdx: number): LsdPage | null;
|
|
1514
1541
|
pages(): LsdPage[];
|
|
1515
1542
|
proxy(): ProxyInController | null;
|
|
@@ -1545,7 +1572,8 @@ declare class PuppeteerPage extends EventEmitter implements LsdPage {
|
|
|
1545
1572
|
free(): Promise<boolean>;
|
|
1546
1573
|
goto(url: string, options?: GotoOptions | undefined): Promise<boolean>;
|
|
1547
1574
|
id(): string;
|
|
1548
|
-
|
|
1575
|
+
isAvailable(domainName?: string): boolean;
|
|
1576
|
+
lastStatusUpdateTime(): number;
|
|
1549
1577
|
localStroage(): Promise<LocalStorageOrigin[]>;
|
|
1550
1578
|
load(): boolean;
|
|
1551
1579
|
mainFrame(): AllFrame;
|
|
@@ -1651,7 +1679,8 @@ declare class CheerioPage extends EventEmitter implements LsdPage {
|
|
|
1651
1679
|
free(): Promise<boolean>;
|
|
1652
1680
|
goto(): Promise<boolean>;
|
|
1653
1681
|
id(): string;
|
|
1654
|
-
|
|
1682
|
+
isAvailable(): boolean;
|
|
1683
|
+
lastStatusUpdateTime(): number;
|
|
1655
1684
|
load(html: string, isHtml?: boolean): boolean;
|
|
1656
1685
|
localStroage(): Promise<LocalStorageOrigin[]>;
|
|
1657
1686
|
mainFrame(): AllFrame;
|
|
@@ -1733,4 +1762,4 @@ declare class LsdBrowserController implements LsdBrowserController$1 {
|
|
|
1733
1762
|
}
|
|
1734
1763
|
declare const controller: LsdBrowserController;
|
|
1735
1764
|
|
|
1736
|
-
export { type AllApiRequestContext, type AllBrowser, type AllBrowserContext, type AllElement, type AllElementHandle, type AllFrame, type AllPage, type AllResponse, type BrowserContextCreationMethod, type BrowserContextRequirements, type BrowserContextStatus, type BrowserControllerType, type BrowserCreationMethod, type BrowserLaunchMethod, type BrowserStateData, CheerioElement, type CheerioNode, CheerioPage, type ClientCertificate, ControllerEvent, type CookieItem, type FrameAddScriptTagOptions, type GotoOptions, type IframeOption, type InputOptions, type KeyInput, type KeyPressOptions, type LocalStorageItem, type LocalStorageOrigin, type LowerCasePaperFormat, type LsdApiContext, type LsdApiContextOptions, type LsdApiResponse, type LsdBrowser, type LsdBrowserContext, LsdBrowserContextEvent, type LsdBrowserContextOptions, type LsdBrowserController$1 as LsdBrowserController, LsdBrowserEvent, type LsdBrowserType, type LsdConnectOptions, type LsdElement, type LsdFetchOptions, type LsdLaunchOptions, type LsdPage, LsdPageEvent, type MouseClickOptions, type MouseClickType, type NavigationWaitUntil, type PDFMargin, type PDFOptions, type PageExtInPatchright, type PageExtInPlaywright, type PageExtInPuppeteer, type PageInfo, type PageMouseClickOptions, type PageOpenType, type PageStatus, type PaperFormat, type PatchrightBrowserTypes, PlaywrightBrowser, PlaywrightBrowserContext, type PlaywrightBrowserControllerType, type PlaywrightBrowserTypes, PlaywrightElement, PlaywrightPage, type ProxyInController, PuppeteerBrowser, PuppeteerBrowserContext, PuppeteerElement, PuppeteerPage, type RequestInterceptionAction, type RequestInterceptionOption, type RequestMatch, type RequestMethod, type RequestResourceType, type ResponseHandler, type ResponseHandlerOptions, type ResponseInterceptionItem, type ResponseInterceptionOption, type ResponseMatch, type ResponsePageData, type ScreenshotOptions, type SelectOptions, type UpdatablePageInfo, type ViewportSize, type WaitElementOptions, type WaitElementState, type WaitNavigationOptions, controller, setControllerLogFun };
|
|
1765
|
+
export { type AllApiRequestContext, type AllBrowser, type AllBrowserContext, type AllElement, type AllElementHandle, type AllFrame, type AllPage, type AllResponse, type BrowserContextCreationMethod, type BrowserContextRequirements, type BrowserContextStatus, type BrowserControllerType, type BrowserCreationMethod, type BrowserLaunchMethod, type BrowserStateData, CheerioElement, type CheerioNode, CheerioPage, type ClientCertificate, ControllerEvent, type CookieItem, type FrameAddScriptTagOptions, type GotoOptions, type IframeOption, type InputOptions, type KeyInput, type KeyPressOptions, type LocalStorageItem, type LocalStorageOrigin, type LowerCasePaperFormat, type LsdApiContext, type LsdApiContextOptions, type LsdApiResponse, type LsdBrowser, type LsdBrowserContext, LsdBrowserContextEvent, type LsdBrowserContextOptions, type LsdBrowserController$1 as LsdBrowserController, LsdBrowserEvent, type LsdBrowserType, type LsdConnectOptions, type LsdElement, type LsdFetchOptions, type LsdLaunchOptions, type LsdPage, LsdPageEvent, type MouseClickOptions, type MouseClickType, type NavigationWaitUntil, type PDFMargin, type PDFOptions, POPUP_TASK_ID, type PageExtInPatchright, type PageExtInPlaywright, type PageExtInPuppeteer, type PageInfo, type PageMouseClickOptions, type PageOpenType, type PageStatus, type PaperFormat, type PatchrightBrowserTypes, PlaywrightBrowser, PlaywrightBrowserContext, type PlaywrightBrowserControllerType, type PlaywrightBrowserTypes, PlaywrightElement, PlaywrightPage, type ProxyInController, PuppeteerBrowser, PuppeteerBrowserContext, PuppeteerElement, PuppeteerPage, type RequestInterceptionAction, type RequestInterceptionOption, type RequestMatch, type RequestMethod, type RequestResourceType, type ResponseHandler, type ResponseHandlerOptions, type ResponseInterceptionItem, type ResponseInterceptionOption, type ResponseMatch, type ResponsePageData, type ScreenshotOptions, type SelectOptions, type UpdatablePageInfo, type ViewportSize, type WaitElementOptions, type WaitElementState, type WaitNavigationOptions, controller, setControllerLogFun };
|
package/dist/index.d.ts
CHANGED
|
@@ -159,6 +159,11 @@ interface BrowserOptions {
|
|
|
159
159
|
* @default 900
|
|
160
160
|
*/
|
|
161
161
|
maxPageFreeSeconds?: number;
|
|
162
|
+
/**
|
|
163
|
+
* maximum duration (in seconds) for which the idle page is reserved for tasks with the same domainName.
|
|
164
|
+
* @default 0, that means no reservation
|
|
165
|
+
*/
|
|
166
|
+
maxReservedSeconds?: number;
|
|
162
167
|
/**
|
|
163
168
|
* @default true
|
|
164
169
|
*/
|
|
@@ -284,6 +289,11 @@ type LsdBrowserContextOptions = {
|
|
|
284
289
|
* * puppeteer: set when creating the new page in the browserContext
|
|
285
290
|
*/
|
|
286
291
|
userAgent?: string;
|
|
292
|
+
/**
|
|
293
|
+
* maximum duration (in seconds) for which the idle page is reserved for tasks with the same domainName.
|
|
294
|
+
* @default 0, that means no reservation
|
|
295
|
+
*/
|
|
296
|
+
maxReservedSeconds?: number;
|
|
287
297
|
};
|
|
288
298
|
type PageStatus = "free" | "busy" | "closed";
|
|
289
299
|
/**
|
|
@@ -332,13 +342,14 @@ interface PageInfo {
|
|
|
332
342
|
* page's status: free or busy
|
|
333
343
|
* @default current unix time
|
|
334
344
|
*/
|
|
335
|
-
lastStatusUpdateTime: number;
|
|
336
345
|
/**
|
|
337
346
|
* taskId that are using this page
|
|
338
347
|
* @default 0
|
|
339
348
|
*/
|
|
340
349
|
taskId: number;
|
|
341
350
|
/**
|
|
351
|
+
** popup page: parentTaskId
|
|
352
|
+
** normal page@scraper: templateId
|
|
342
353
|
* @default 0
|
|
343
354
|
*/
|
|
344
355
|
relatedId: number;
|
|
@@ -352,7 +363,6 @@ interface UpdatablePageInfo {
|
|
|
352
363
|
* page's status: free or busy
|
|
353
364
|
* @default current unix time
|
|
354
365
|
*/
|
|
355
|
-
lastStatusUpdateTime?: number;
|
|
356
366
|
/**
|
|
357
367
|
* taskId that are using this page
|
|
358
368
|
* @default 0
|
|
@@ -982,6 +992,7 @@ interface WaitNavigationOptions {
|
|
|
982
992
|
*/
|
|
983
993
|
waitUntil?: NavigationWaitUntil;
|
|
984
994
|
}
|
|
995
|
+
declare const POPUP_TASK_ID = 7;
|
|
985
996
|
interface LsdPage extends EventEmitter {
|
|
986
997
|
/**
|
|
987
998
|
* Adds a script which would be evaluated in one of the following scenarios:
|
|
@@ -1087,7 +1098,14 @@ interface LsdPage extends EventEmitter {
|
|
|
1087
1098
|
*/
|
|
1088
1099
|
goto(url: string, options?: GotoOptions): Promise<boolean>;
|
|
1089
1100
|
id(): string;
|
|
1090
|
-
|
|
1101
|
+
/**
|
|
1102
|
+
* Is the current page free (available) for a new task for domainName?
|
|
1103
|
+
* @param domainName default "":
|
|
1104
|
+
** If it is "" and the current page URL is not "" / "about:blank", the current page must have been idle for maxReservedSeconds; otherwise, return false.
|
|
1105
|
+
** If it is not "", the current page URL must contain domainName; otherwise, return false.
|
|
1106
|
+
*/
|
|
1107
|
+
isAvailable(domainName?: string): boolean;
|
|
1108
|
+
lastStatusUpdateTime(): number;
|
|
1091
1109
|
/**
|
|
1092
1110
|
* valid only in CheerioPage
|
|
1093
1111
|
* @param html
|
|
@@ -1213,8 +1231,10 @@ interface LsdBrowserContext extends EventEmitter {
|
|
|
1213
1231
|
free(clearStateData?: boolean): boolean;
|
|
1214
1232
|
/**
|
|
1215
1233
|
* get a free page from current pages or by creating a new page
|
|
1234
|
+
* @param domainName default "", if it is not "", prioritize retrieving from a free page whose URL includes that value
|
|
1235
|
+
* @param always default false, whether a (new) page is always allocated, ignoring maxPagesPerBrowserContext
|
|
1216
1236
|
*/
|
|
1217
|
-
getPage(always?: boolean): Promise<LsdPage | null>;
|
|
1237
|
+
getPage(domainName?: string, always?: boolean): Promise<LsdPage | null>;
|
|
1218
1238
|
/**
|
|
1219
1239
|
* whether can get a number of free page(s)
|
|
1220
1240
|
* * refer to getPage()
|
|
@@ -1225,6 +1245,10 @@ interface LsdBrowserContext extends EventEmitter {
|
|
|
1225
1245
|
isFree(): boolean;
|
|
1226
1246
|
isIncognito(): boolean;
|
|
1227
1247
|
creationMethod(): BrowserContextCreationMethod;
|
|
1248
|
+
/**
|
|
1249
|
+
* get maximum duration (in seconds) for which the idle page is reserved for tasks with the same domainName.
|
|
1250
|
+
*/
|
|
1251
|
+
maxReservedSeconds(): number;
|
|
1228
1252
|
page(pageIdx: number): LsdPage | null;
|
|
1229
1253
|
pages(): LsdPage[];
|
|
1230
1254
|
proxy(): ProxyInController | null;
|
|
@@ -1347,19 +1371,20 @@ declare class PlaywrightBrowser extends EventEmitter implements LsdBrowser {
|
|
|
1347
1371
|
|
|
1348
1372
|
declare class PlaywrightBrowserContext extends EventEmitter implements LsdBrowserContext {
|
|
1349
1373
|
#private;
|
|
1350
|
-
constructor(lsdBrowser: LsdBrowser, browserContext: BrowserContext, browserContextCreationMethod: BrowserContextCreationMethod, incognito?: boolean, proxy?: ProxyInController | null, browserIdx?: number, browserContextIdx?: number, maxPagesPerBrowserContext?: number, maxPageFreeSeconds?: number, userAgent?: string, maxViewportOfNewPage?: boolean);
|
|
1374
|
+
constructor(lsdBrowser: LsdBrowser, browserContext: BrowserContext, browserContextCreationMethod: BrowserContextCreationMethod, incognito?: boolean, proxy?: ProxyInController | null, browserIdx?: number, browserContextIdx?: number, maxPagesPerBrowserContext?: number, maxPageFreeSeconds?: number, userAgent?: string, maxReservedSeconds?: number, maxViewportOfNewPage?: boolean);
|
|
1351
1375
|
apiContext(): LsdApiContext;
|
|
1352
1376
|
browser(): LsdBrowser;
|
|
1353
1377
|
close(): Promise<boolean>;
|
|
1354
1378
|
closeFreePages(maxPageFreeSeconds?: number): Promise<boolean>;
|
|
1355
1379
|
creationMethod(): BrowserContextCreationMethod;
|
|
1356
1380
|
doesMeetBrowserContextRequirements(browserContextRequirements: BrowserContextRequirements): boolean;
|
|
1357
|
-
getPage(always?: boolean): Promise<LsdPage | null>;
|
|
1381
|
+
getPage(domainName?: string, always?: boolean): Promise<LsdPage | null>;
|
|
1358
1382
|
free(clearStateData?: boolean): boolean;
|
|
1359
1383
|
hasFreePage(pageNum?: number): boolean;
|
|
1360
1384
|
id(): string;
|
|
1361
1385
|
isFree(): boolean;
|
|
1362
1386
|
isIncognito(): boolean;
|
|
1387
|
+
maxReservedSeconds(): number;
|
|
1363
1388
|
page(pageIdx: number): LsdPage | null;
|
|
1364
1389
|
pages(): LsdPage[];
|
|
1365
1390
|
proxy(): ProxyInController | null;
|
|
@@ -1395,7 +1420,8 @@ declare class PlaywrightPage extends EventEmitter implements LsdPage {
|
|
|
1395
1420
|
free(): Promise<boolean>;
|
|
1396
1421
|
goto(url: string, options?: GotoOptions | undefined): Promise<boolean>;
|
|
1397
1422
|
id(): string;
|
|
1398
|
-
|
|
1423
|
+
isAvailable(domainName?: string): boolean;
|
|
1424
|
+
lastStatusUpdateTime(): number;
|
|
1399
1425
|
localStroage(): Promise<LocalStorageOrigin[]>;
|
|
1400
1426
|
load(): boolean;
|
|
1401
1427
|
mainFrame(): AllFrame;
|
|
@@ -1497,19 +1523,20 @@ declare class PuppeteerBrowser extends EventEmitter implements LsdBrowser {
|
|
|
1497
1523
|
|
|
1498
1524
|
declare class PuppeteerBrowserContext extends EventEmitter implements LsdBrowserContext {
|
|
1499
1525
|
#private;
|
|
1500
|
-
constructor(lsdBrowser: LsdBrowser, browserContext: BrowserContext$1, browserContextCreationMethod: BrowserContextCreationMethod, incognito?: boolean, proxy?: ProxyInController | null, browserIdx?: number, browserContextIdx?: number, maxPagesPerBrowserContext?: number, maxPageFreeSeconds?: number, userAgent?: string, maxViewportOfNewPage?: boolean);
|
|
1526
|
+
constructor(lsdBrowser: LsdBrowser, browserContext: BrowserContext$1, browserContextCreationMethod: BrowserContextCreationMethod, incognito?: boolean, proxy?: ProxyInController | null, browserIdx?: number, browserContextIdx?: number, maxPagesPerBrowserContext?: number, maxPageFreeSeconds?: number, userAgent?: string, maxReservedSeconds?: number, maxViewportOfNewPage?: boolean);
|
|
1501
1527
|
apiContext(): LsdApiContext;
|
|
1502
1528
|
browser(): LsdBrowser;
|
|
1503
1529
|
close(): Promise<boolean>;
|
|
1504
1530
|
closeFreePages(maxPageFreeSeconds?: number): Promise<boolean>;
|
|
1505
1531
|
creationMethod(): BrowserContextCreationMethod;
|
|
1506
1532
|
doesMeetBrowserContextRequirements(browserContextRequirements: BrowserContextRequirements): boolean;
|
|
1507
|
-
getPage(always?: boolean): Promise<LsdPage | null>;
|
|
1533
|
+
getPage(domainName?: string, always?: boolean): Promise<LsdPage | null>;
|
|
1508
1534
|
free(clearStateData?: boolean): boolean;
|
|
1509
1535
|
hasFreePage(pageNum?: number): boolean;
|
|
1510
1536
|
id(): string;
|
|
1511
1537
|
isIncognito(): boolean;
|
|
1512
1538
|
isFree(): boolean;
|
|
1539
|
+
maxReservedSeconds(): number;
|
|
1513
1540
|
page(pageIdx: number): LsdPage | null;
|
|
1514
1541
|
pages(): LsdPage[];
|
|
1515
1542
|
proxy(): ProxyInController | null;
|
|
@@ -1545,7 +1572,8 @@ declare class PuppeteerPage extends EventEmitter implements LsdPage {
|
|
|
1545
1572
|
free(): Promise<boolean>;
|
|
1546
1573
|
goto(url: string, options?: GotoOptions | undefined): Promise<boolean>;
|
|
1547
1574
|
id(): string;
|
|
1548
|
-
|
|
1575
|
+
isAvailable(domainName?: string): boolean;
|
|
1576
|
+
lastStatusUpdateTime(): number;
|
|
1549
1577
|
localStroage(): Promise<LocalStorageOrigin[]>;
|
|
1550
1578
|
load(): boolean;
|
|
1551
1579
|
mainFrame(): AllFrame;
|
|
@@ -1651,7 +1679,8 @@ declare class CheerioPage extends EventEmitter implements LsdPage {
|
|
|
1651
1679
|
free(): Promise<boolean>;
|
|
1652
1680
|
goto(): Promise<boolean>;
|
|
1653
1681
|
id(): string;
|
|
1654
|
-
|
|
1682
|
+
isAvailable(): boolean;
|
|
1683
|
+
lastStatusUpdateTime(): number;
|
|
1655
1684
|
load(html: string, isHtml?: boolean): boolean;
|
|
1656
1685
|
localStroage(): Promise<LocalStorageOrigin[]>;
|
|
1657
1686
|
mainFrame(): AllFrame;
|
|
@@ -1733,4 +1762,4 @@ declare class LsdBrowserController implements LsdBrowserController$1 {
|
|
|
1733
1762
|
}
|
|
1734
1763
|
declare const controller: LsdBrowserController;
|
|
1735
1764
|
|
|
1736
|
-
export { type AllApiRequestContext, type AllBrowser, type AllBrowserContext, type AllElement, type AllElementHandle, type AllFrame, type AllPage, type AllResponse, type BrowserContextCreationMethod, type BrowserContextRequirements, type BrowserContextStatus, type BrowserControllerType, type BrowserCreationMethod, type BrowserLaunchMethod, type BrowserStateData, CheerioElement, type CheerioNode, CheerioPage, type ClientCertificate, ControllerEvent, type CookieItem, type FrameAddScriptTagOptions, type GotoOptions, type IframeOption, type InputOptions, type KeyInput, type KeyPressOptions, type LocalStorageItem, type LocalStorageOrigin, type LowerCasePaperFormat, type LsdApiContext, type LsdApiContextOptions, type LsdApiResponse, type LsdBrowser, type LsdBrowserContext, LsdBrowserContextEvent, type LsdBrowserContextOptions, type LsdBrowserController$1 as LsdBrowserController, LsdBrowserEvent, type LsdBrowserType, type LsdConnectOptions, type LsdElement, type LsdFetchOptions, type LsdLaunchOptions, type LsdPage, LsdPageEvent, type MouseClickOptions, type MouseClickType, type NavigationWaitUntil, type PDFMargin, type PDFOptions, type PageExtInPatchright, type PageExtInPlaywright, type PageExtInPuppeteer, type PageInfo, type PageMouseClickOptions, type PageOpenType, type PageStatus, type PaperFormat, type PatchrightBrowserTypes, PlaywrightBrowser, PlaywrightBrowserContext, type PlaywrightBrowserControllerType, type PlaywrightBrowserTypes, PlaywrightElement, PlaywrightPage, type ProxyInController, PuppeteerBrowser, PuppeteerBrowserContext, PuppeteerElement, PuppeteerPage, type RequestInterceptionAction, type RequestInterceptionOption, type RequestMatch, type RequestMethod, type RequestResourceType, type ResponseHandler, type ResponseHandlerOptions, type ResponseInterceptionItem, type ResponseInterceptionOption, type ResponseMatch, type ResponsePageData, type ScreenshotOptions, type SelectOptions, type UpdatablePageInfo, type ViewportSize, type WaitElementOptions, type WaitElementState, type WaitNavigationOptions, controller, setControllerLogFun };
|
|
1765
|
+
export { type AllApiRequestContext, type AllBrowser, type AllBrowserContext, type AllElement, type AllElementHandle, type AllFrame, type AllPage, type AllResponse, type BrowserContextCreationMethod, type BrowserContextRequirements, type BrowserContextStatus, type BrowserControllerType, type BrowserCreationMethod, type BrowserLaunchMethod, type BrowserStateData, CheerioElement, type CheerioNode, CheerioPage, type ClientCertificate, ControllerEvent, type CookieItem, type FrameAddScriptTagOptions, type GotoOptions, type IframeOption, type InputOptions, type KeyInput, type KeyPressOptions, type LocalStorageItem, type LocalStorageOrigin, type LowerCasePaperFormat, type LsdApiContext, type LsdApiContextOptions, type LsdApiResponse, type LsdBrowser, type LsdBrowserContext, LsdBrowserContextEvent, type LsdBrowserContextOptions, type LsdBrowserController$1 as LsdBrowserController, LsdBrowserEvent, type LsdBrowserType, type LsdConnectOptions, type LsdElement, type LsdFetchOptions, type LsdLaunchOptions, type LsdPage, LsdPageEvent, type MouseClickOptions, type MouseClickType, type NavigationWaitUntil, type PDFMargin, type PDFOptions, POPUP_TASK_ID, type PageExtInPatchright, type PageExtInPlaywright, type PageExtInPuppeteer, type PageInfo, type PageMouseClickOptions, type PageOpenType, type PageStatus, type PaperFormat, type PatchrightBrowserTypes, PlaywrightBrowser, PlaywrightBrowserContext, type PlaywrightBrowserControllerType, type PlaywrightBrowserTypes, PlaywrightElement, PlaywrightPage, type ProxyInController, PuppeteerBrowser, PuppeteerBrowserContext, PuppeteerElement, PuppeteerPage, type RequestInterceptionAction, type RequestInterceptionOption, type RequestMatch, type RequestMethod, type RequestResourceType, type ResponseHandler, type ResponseHandlerOptions, type ResponseInterceptionItem, type ResponseInterceptionOption, type ResponseMatch, type ResponsePageData, type ScreenshotOptions, type SelectOptions, type UpdatablePageInfo, type ViewportSize, type WaitElementOptions, type WaitElementState, type WaitNavigationOptions, controller, setControllerLogFun };
|