@letsscrapedata/controller 0.0.36 → 0.0.38
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 +309 -14126
- package/dist/index.d.cts +85 -22
- package/dist/index.d.ts +85 -22
- package/dist/index.js +301 -14145
- package/package.json +50 -47
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import EventEmitter from 'node:events';
|
|
2
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, APIRequestContext, BrowserType, Locator, FrameLocator } from 'playwright';
|
|
4
|
-
import * as cheerio from 'cheerio';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* 命名规则:为了与playwright/puppeteer中的同名区别
|
|
8
|
-
* 1.
|
|
9
|
-
* 2.
|
|
10
|
-
* 3. 接口的实现类class的名称: LsdXxxYyy,如LsdBrowserContext
|
|
7
|
+
* 1. name of type:AllXxxYyy,如AllBrowserContext
|
|
8
|
+
* 2. 接口的实现类class的名称: LsdXxxYyy,如LsdBrowserContext
|
|
11
9
|
*/
|
|
12
10
|
|
|
13
11
|
type AllBrowser = Browser | Browser$1;
|
|
@@ -16,16 +14,74 @@ type AllFrame = Frame | Frame$1;
|
|
|
16
14
|
type AllPage = Page | Page$1;
|
|
17
15
|
type AllResponse = Response | HTTPResponse;
|
|
18
16
|
type AllApiRequestContext = APIRequestContext;
|
|
19
|
-
type CheerioNode = cheerio.Cheerio
|
|
20
|
-
type
|
|
17
|
+
type CheerioNode = cheerio.Cheerio;
|
|
18
|
+
type BrowserControllerType = "puppeteer" | "playwright";
|
|
19
|
+
type BrowserCreationMethod = "launch" | "connect";
|
|
20
|
+
type LsdBrowserType = "chromium" | "firefox" | "webkit";
|
|
21
|
+
interface ProxyInController {
|
|
21
22
|
proxyUrl: string;
|
|
22
23
|
username?: string;
|
|
23
24
|
password?: string;
|
|
24
25
|
proxyId?: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
}
|
|
27
|
+
interface ClientCertificate {
|
|
28
|
+
origin: string;
|
|
29
|
+
cert?: Buffer;
|
|
30
|
+
certPath?: string;
|
|
31
|
+
key?: Buffer;
|
|
32
|
+
keyPath?: string;
|
|
33
|
+
pfx?: Buffer;
|
|
34
|
+
pfxPath?: string;
|
|
35
|
+
passphrase?: string;
|
|
36
|
+
}
|
|
37
|
+
interface LsdApiContextOptions {
|
|
38
|
+
proxy?: ProxyInController;
|
|
39
|
+
/**
|
|
40
|
+
* storageState
|
|
41
|
+
*/
|
|
42
|
+
stateData?: BrowserStateData;
|
|
43
|
+
userAgent?: string;
|
|
44
|
+
timeout?: number;
|
|
45
|
+
ignoreHTTPSErrors?: boolean;
|
|
46
|
+
extraHTTPHeaders?: Record<string, string>;
|
|
47
|
+
httpCredentials?: {
|
|
48
|
+
username: string;
|
|
49
|
+
password: string;
|
|
50
|
+
origin?: string;
|
|
51
|
+
send?: 'always' | 'unauthorized';
|
|
52
|
+
};
|
|
53
|
+
clientCertificates?: ClientCertificate[];
|
|
54
|
+
}
|
|
55
|
+
interface LsdFetchOptions {
|
|
56
|
+
/**
|
|
57
|
+
* @default "get"
|
|
58
|
+
*/
|
|
59
|
+
method?: "delete" | "get" | "post" | "put";
|
|
60
|
+
params?: Record<string, string | number | boolean>;
|
|
61
|
+
headers?: Record<string, string>;
|
|
62
|
+
data?: any;
|
|
63
|
+
form?: Record<string, string | number | boolean>;
|
|
64
|
+
timeout?: number;
|
|
65
|
+
failOnStatusCode?: boolean;
|
|
66
|
+
ignoreHTTPSErrors?: boolean;
|
|
67
|
+
maxRedirects?: number;
|
|
68
|
+
maxRetries?: number;
|
|
69
|
+
}
|
|
70
|
+
interface LsdApiResponse {
|
|
71
|
+
headers: Record<string, string>;
|
|
72
|
+
status: number;
|
|
73
|
+
statusText: string;
|
|
74
|
+
text: string;
|
|
75
|
+
url: string;
|
|
76
|
+
}
|
|
77
|
+
interface LsdApiContext {
|
|
78
|
+
fetch(url: string, options?: LsdFetchOptions): Promise<LsdApiResponse>;
|
|
79
|
+
stateData(): Promise<BrowserStateData>;
|
|
80
|
+
/**
|
|
81
|
+
* destroyed LsdApiContext cannot be used again, or throw an exeception
|
|
82
|
+
*/
|
|
83
|
+
destroy(): Promise<boolean>;
|
|
84
|
+
}
|
|
29
85
|
interface PlaywrightBrowserTypes {
|
|
30
86
|
chromium: BrowserType;
|
|
31
87
|
firefox: BrowserType;
|
|
@@ -771,10 +827,10 @@ interface WaitNavigationOptions {
|
|
|
771
827
|
type PageEvent = "pageClose" | "pagePopup";
|
|
772
828
|
interface LsdPage extends EventEmitter {
|
|
773
829
|
/**
|
|
774
|
-
* Get the
|
|
830
|
+
* Get the LsdApiContext associated with this page's LsdBrowserContext
|
|
775
831
|
* * only vaild in playwright
|
|
776
832
|
*/
|
|
777
|
-
|
|
833
|
+
apiContext(): LsdApiContext;
|
|
778
834
|
bringToFront(): Promise<boolean>;
|
|
779
835
|
browserContext(): LsdBrowserContext;
|
|
780
836
|
/**
|
|
@@ -916,6 +972,11 @@ interface LsdPage extends EventEmitter {
|
|
|
916
972
|
_origPage(): AllPage;
|
|
917
973
|
}
|
|
918
974
|
interface LsdBrowserContext extends EventEmitter {
|
|
975
|
+
/**
|
|
976
|
+
* Get the LsdApiContext associated with this LsdBrowserContext
|
|
977
|
+
* * only vaild in playwright
|
|
978
|
+
*/
|
|
979
|
+
apiContext(): LsdApiContext;
|
|
919
980
|
browser(): LsdBrowser;
|
|
920
981
|
close(): Promise<boolean>;
|
|
921
982
|
/**
|
|
@@ -933,7 +994,7 @@ interface LsdBrowserContext extends EventEmitter {
|
|
|
933
994
|
* * refer to getPage()
|
|
934
995
|
* @param pageNum default 1, the number of free pages
|
|
935
996
|
*/
|
|
936
|
-
|
|
997
|
+
hasFreePage(pageNum?: number): boolean;
|
|
937
998
|
id(): string;
|
|
938
999
|
isIncognito(): boolean;
|
|
939
1000
|
page(pageIdx: number): LsdPage | null;
|
|
@@ -1009,9 +1070,9 @@ interface LsdBrowserController$1 {
|
|
|
1009
1070
|
*/
|
|
1010
1071
|
setPlaywrightBrowserType(browserType: LsdBrowserType, playwrightBrowserType: BrowserType | null): boolean;
|
|
1011
1072
|
/**
|
|
1012
|
-
* Create a new
|
|
1073
|
+
* Create a new LsdApiContext, valid in playwright;
|
|
1013
1074
|
*/
|
|
1014
|
-
|
|
1075
|
+
newApiContext(options?: LsdApiContextOptions): Promise<LsdApiContext>;
|
|
1015
1076
|
}
|
|
1016
1077
|
/**
|
|
1017
1078
|
* globObj.cfg.XXX:
|
|
@@ -1067,11 +1128,12 @@ declare class PlaywrightBrowser extends EventEmitter implements LsdBrowser {
|
|
|
1067
1128
|
declare class PlaywrightBrowserContext extends EventEmitter implements LsdBrowserContext {
|
|
1068
1129
|
#private;
|
|
1069
1130
|
constructor(lsdBrowser: LsdBrowser, browserContext: BrowserContext, incognito?: boolean, proxy?: ProxyInController | null, browserIdx?: number, browserContextIdx?: number, maxPagesPerBrowserContext?: number, maxPageFreeSeconds?: number, maxViewportOfNewPage?: boolean);
|
|
1131
|
+
apiContext(): LsdApiContext;
|
|
1070
1132
|
browser(): LsdBrowser;
|
|
1071
1133
|
close(): Promise<boolean>;
|
|
1072
1134
|
closeFreePages(maxPageFreeSeconds?: number): Promise<boolean>;
|
|
1073
1135
|
getPage(always?: boolean): Promise<LsdPage | null>;
|
|
1074
|
-
|
|
1136
|
+
hasFreePage(pageNum?: number): boolean;
|
|
1075
1137
|
id(): string;
|
|
1076
1138
|
isIncognito(): boolean;
|
|
1077
1139
|
page(pageIdx: number): LsdPage | null;
|
|
@@ -1084,7 +1146,7 @@ declare class PlaywrightBrowserContext extends EventEmitter implements LsdBrowse
|
|
|
1084
1146
|
declare class PlaywrightPage extends EventEmitter implements LsdPage {
|
|
1085
1147
|
#private;
|
|
1086
1148
|
constructor(browserContext: LsdBrowserContext, page: Page, pageInfo?: PageInfo);
|
|
1087
|
-
|
|
1149
|
+
apiContext(): LsdApiContext;
|
|
1088
1150
|
bringToFront(): Promise<boolean>;
|
|
1089
1151
|
browserContext(): LsdBrowserContext;
|
|
1090
1152
|
clearCookies(): Promise<boolean>;
|
|
@@ -1183,11 +1245,12 @@ declare class PuppeteerBrowser extends EventEmitter implements LsdBrowser {
|
|
|
1183
1245
|
declare class PuppeteerBrowserContext extends EventEmitter implements LsdBrowserContext {
|
|
1184
1246
|
#private;
|
|
1185
1247
|
constructor(lsdBrowser: LsdBrowser, browserContext: BrowserContext$1, incognito?: boolean, proxy?: ProxyInController | null, browserIdx?: number, browserContextIdx?: number, maxPagesPerBrowserContext?: number, maxPageFreeSeconds?: number, userAgent?: string, maxViewportOfNewPage?: boolean);
|
|
1248
|
+
apiContext(): LsdApiContext;
|
|
1186
1249
|
browser(): LsdBrowser;
|
|
1187
1250
|
close(): Promise<boolean>;
|
|
1188
1251
|
closeFreePages(maxPageFreeSeconds?: number): Promise<boolean>;
|
|
1189
1252
|
getPage(always?: boolean): Promise<LsdPage | null>;
|
|
1190
|
-
|
|
1253
|
+
hasFreePage(pageNum?: number): boolean;
|
|
1191
1254
|
id(): string;
|
|
1192
1255
|
isIncognito(): boolean;
|
|
1193
1256
|
page(pageIdx: number): LsdPage | null;
|
|
@@ -1200,7 +1263,7 @@ declare class PuppeteerBrowserContext extends EventEmitter implements LsdBrowser
|
|
|
1200
1263
|
declare class PuppeteerPage extends EventEmitter implements LsdPage {
|
|
1201
1264
|
#private;
|
|
1202
1265
|
constructor(browserContext: LsdBrowserContext, page: Page$1, pageInfo?: PageInfo);
|
|
1203
|
-
|
|
1266
|
+
apiContext(): LsdApiContext;
|
|
1204
1267
|
bringToFront(): Promise<boolean>;
|
|
1205
1268
|
browserContext(): LsdBrowserContext;
|
|
1206
1269
|
clearCookies(): Promise<boolean>;
|
|
@@ -1282,7 +1345,7 @@ declare class CheerioPage extends EventEmitter implements LsdPage {
|
|
|
1282
1345
|
*/
|
|
1283
1346
|
constructor(html?: string, isHtml?: boolean);
|
|
1284
1347
|
_origPage(): AllPage;
|
|
1285
|
-
|
|
1348
|
+
apiContext(): LsdApiContext;
|
|
1286
1349
|
bringToFront(): Promise<boolean>;
|
|
1287
1350
|
browserContext(): LsdBrowserContext;
|
|
1288
1351
|
clearCookies(): Promise<boolean>;
|
|
@@ -1360,8 +1423,8 @@ declare class LsdBrowserController implements LsdBrowserController$1 {
|
|
|
1360
1423
|
setPlaywrightBrowserType(browserType: LsdBrowserType, playwrightBrowserType: BrowserType | null): boolean;
|
|
1361
1424
|
launch(browserControllerType: BrowserControllerType, browserType: LsdBrowserType, options: LsdLaunchOptions): Promise<LsdBrowser>;
|
|
1362
1425
|
connect(browserControllerType: BrowserControllerType, browserType: LsdBrowserType, options: LsdConnectOptions): Promise<LsdBrowser>;
|
|
1363
|
-
|
|
1426
|
+
newApiContext(options?: LsdApiContextOptions): Promise<LsdApiContext>;
|
|
1364
1427
|
}
|
|
1365
1428
|
declare const controller: LsdBrowserController;
|
|
1366
1429
|
|
|
1367
|
-
export { type AllApiRequestContext, type AllBrowser, type AllBrowserContext, type AllFrame, type AllPage, type AllResponse, type BrowserControllerType, type BrowserCreationMethod, type BrowserLaunchMethod, type BrowserManager, type BrowserStateData, CheerioElement, type CheerioNode, CheerioPage, type CookieItem, type GotoOptions, type IframeOption, type InputOptions, type KeyInput, type KeyPressOptions, type LocalStorageItem, type LocalStorageOrigin, type LowerCasePaperFormat, type LsdBrowser, type LsdBrowserContext, type LsdBrowserContextOptions, type LsdBrowserController$1 as LsdBrowserController, type LsdBrowserType, type LsdConnectOptions, type LsdElement, type LsdLaunchOptions, type LsdPage, type MouseClickOptions, type MouseClickType, type NavigationWaitUntil, type PDFMargin, type PDFOptions, type PageEvent, type PageExtInPlaywright, type PageExtInPuppeteer, type PageInfo, type PageOpenType, type PageStatus, type PaperFormat, PlaywrightBrowser, PlaywrightBrowserContext, 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 };
|
|
1430
|
+
export { type AllApiRequestContext, type AllBrowser, type AllBrowserContext, type AllFrame, type AllPage, type AllResponse, type BrowserControllerType, type BrowserCreationMethod, type BrowserLaunchMethod, type BrowserManager, type BrowserStateData, CheerioElement, type CheerioNode, CheerioPage, type ClientCertificate, type CookieItem, 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, type LsdBrowserContextOptions, type LsdBrowserController$1 as LsdBrowserController, type LsdBrowserType, type LsdConnectOptions, type LsdElement, type LsdFetchOptions, type LsdLaunchOptions, type LsdPage, type MouseClickOptions, type MouseClickType, type NavigationWaitUntil, type PDFMargin, type PDFOptions, type PageEvent, type PageExtInPlaywright, type PageExtInPuppeteer, type PageInfo, type PageOpenType, type PageStatus, type PaperFormat, PlaywrightBrowser, PlaywrightBrowserContext, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import EventEmitter from 'node:events';
|
|
2
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, APIRequestContext, BrowserType, Locator, FrameLocator } from 'playwright';
|
|
4
|
-
import * as cheerio from 'cheerio';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* 命名规则:为了与playwright/puppeteer中的同名区别
|
|
8
|
-
* 1.
|
|
9
|
-
* 2.
|
|
10
|
-
* 3. 接口的实现类class的名称: LsdXxxYyy,如LsdBrowserContext
|
|
7
|
+
* 1. name of type:AllXxxYyy,如AllBrowserContext
|
|
8
|
+
* 2. 接口的实现类class的名称: LsdXxxYyy,如LsdBrowserContext
|
|
11
9
|
*/
|
|
12
10
|
|
|
13
11
|
type AllBrowser = Browser | Browser$1;
|
|
@@ -16,16 +14,74 @@ type AllFrame = Frame | Frame$1;
|
|
|
16
14
|
type AllPage = Page | Page$1;
|
|
17
15
|
type AllResponse = Response | HTTPResponse;
|
|
18
16
|
type AllApiRequestContext = APIRequestContext;
|
|
19
|
-
type CheerioNode = cheerio.Cheerio
|
|
20
|
-
type
|
|
17
|
+
type CheerioNode = cheerio.Cheerio;
|
|
18
|
+
type BrowserControllerType = "puppeteer" | "playwright";
|
|
19
|
+
type BrowserCreationMethod = "launch" | "connect";
|
|
20
|
+
type LsdBrowserType = "chromium" | "firefox" | "webkit";
|
|
21
|
+
interface ProxyInController {
|
|
21
22
|
proxyUrl: string;
|
|
22
23
|
username?: string;
|
|
23
24
|
password?: string;
|
|
24
25
|
proxyId?: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
}
|
|
27
|
+
interface ClientCertificate {
|
|
28
|
+
origin: string;
|
|
29
|
+
cert?: Buffer;
|
|
30
|
+
certPath?: string;
|
|
31
|
+
key?: Buffer;
|
|
32
|
+
keyPath?: string;
|
|
33
|
+
pfx?: Buffer;
|
|
34
|
+
pfxPath?: string;
|
|
35
|
+
passphrase?: string;
|
|
36
|
+
}
|
|
37
|
+
interface LsdApiContextOptions {
|
|
38
|
+
proxy?: ProxyInController;
|
|
39
|
+
/**
|
|
40
|
+
* storageState
|
|
41
|
+
*/
|
|
42
|
+
stateData?: BrowserStateData;
|
|
43
|
+
userAgent?: string;
|
|
44
|
+
timeout?: number;
|
|
45
|
+
ignoreHTTPSErrors?: boolean;
|
|
46
|
+
extraHTTPHeaders?: Record<string, string>;
|
|
47
|
+
httpCredentials?: {
|
|
48
|
+
username: string;
|
|
49
|
+
password: string;
|
|
50
|
+
origin?: string;
|
|
51
|
+
send?: 'always' | 'unauthorized';
|
|
52
|
+
};
|
|
53
|
+
clientCertificates?: ClientCertificate[];
|
|
54
|
+
}
|
|
55
|
+
interface LsdFetchOptions {
|
|
56
|
+
/**
|
|
57
|
+
* @default "get"
|
|
58
|
+
*/
|
|
59
|
+
method?: "delete" | "get" | "post" | "put";
|
|
60
|
+
params?: Record<string, string | number | boolean>;
|
|
61
|
+
headers?: Record<string, string>;
|
|
62
|
+
data?: any;
|
|
63
|
+
form?: Record<string, string | number | boolean>;
|
|
64
|
+
timeout?: number;
|
|
65
|
+
failOnStatusCode?: boolean;
|
|
66
|
+
ignoreHTTPSErrors?: boolean;
|
|
67
|
+
maxRedirects?: number;
|
|
68
|
+
maxRetries?: number;
|
|
69
|
+
}
|
|
70
|
+
interface LsdApiResponse {
|
|
71
|
+
headers: Record<string, string>;
|
|
72
|
+
status: number;
|
|
73
|
+
statusText: string;
|
|
74
|
+
text: string;
|
|
75
|
+
url: string;
|
|
76
|
+
}
|
|
77
|
+
interface LsdApiContext {
|
|
78
|
+
fetch(url: string, options?: LsdFetchOptions): Promise<LsdApiResponse>;
|
|
79
|
+
stateData(): Promise<BrowserStateData>;
|
|
80
|
+
/**
|
|
81
|
+
* destroyed LsdApiContext cannot be used again, or throw an exeception
|
|
82
|
+
*/
|
|
83
|
+
destroy(): Promise<boolean>;
|
|
84
|
+
}
|
|
29
85
|
interface PlaywrightBrowserTypes {
|
|
30
86
|
chromium: BrowserType;
|
|
31
87
|
firefox: BrowserType;
|
|
@@ -771,10 +827,10 @@ interface WaitNavigationOptions {
|
|
|
771
827
|
type PageEvent = "pageClose" | "pagePopup";
|
|
772
828
|
interface LsdPage extends EventEmitter {
|
|
773
829
|
/**
|
|
774
|
-
* Get the
|
|
830
|
+
* Get the LsdApiContext associated with this page's LsdBrowserContext
|
|
775
831
|
* * only vaild in playwright
|
|
776
832
|
*/
|
|
777
|
-
|
|
833
|
+
apiContext(): LsdApiContext;
|
|
778
834
|
bringToFront(): Promise<boolean>;
|
|
779
835
|
browserContext(): LsdBrowserContext;
|
|
780
836
|
/**
|
|
@@ -916,6 +972,11 @@ interface LsdPage extends EventEmitter {
|
|
|
916
972
|
_origPage(): AllPage;
|
|
917
973
|
}
|
|
918
974
|
interface LsdBrowserContext extends EventEmitter {
|
|
975
|
+
/**
|
|
976
|
+
* Get the LsdApiContext associated with this LsdBrowserContext
|
|
977
|
+
* * only vaild in playwright
|
|
978
|
+
*/
|
|
979
|
+
apiContext(): LsdApiContext;
|
|
919
980
|
browser(): LsdBrowser;
|
|
920
981
|
close(): Promise<boolean>;
|
|
921
982
|
/**
|
|
@@ -933,7 +994,7 @@ interface LsdBrowserContext extends EventEmitter {
|
|
|
933
994
|
* * refer to getPage()
|
|
934
995
|
* @param pageNum default 1, the number of free pages
|
|
935
996
|
*/
|
|
936
|
-
|
|
997
|
+
hasFreePage(pageNum?: number): boolean;
|
|
937
998
|
id(): string;
|
|
938
999
|
isIncognito(): boolean;
|
|
939
1000
|
page(pageIdx: number): LsdPage | null;
|
|
@@ -1009,9 +1070,9 @@ interface LsdBrowserController$1 {
|
|
|
1009
1070
|
*/
|
|
1010
1071
|
setPlaywrightBrowserType(browserType: LsdBrowserType, playwrightBrowserType: BrowserType | null): boolean;
|
|
1011
1072
|
/**
|
|
1012
|
-
* Create a new
|
|
1073
|
+
* Create a new LsdApiContext, valid in playwright;
|
|
1013
1074
|
*/
|
|
1014
|
-
|
|
1075
|
+
newApiContext(options?: LsdApiContextOptions): Promise<LsdApiContext>;
|
|
1015
1076
|
}
|
|
1016
1077
|
/**
|
|
1017
1078
|
* globObj.cfg.XXX:
|
|
@@ -1067,11 +1128,12 @@ declare class PlaywrightBrowser extends EventEmitter implements LsdBrowser {
|
|
|
1067
1128
|
declare class PlaywrightBrowserContext extends EventEmitter implements LsdBrowserContext {
|
|
1068
1129
|
#private;
|
|
1069
1130
|
constructor(lsdBrowser: LsdBrowser, browserContext: BrowserContext, incognito?: boolean, proxy?: ProxyInController | null, browserIdx?: number, browserContextIdx?: number, maxPagesPerBrowserContext?: number, maxPageFreeSeconds?: number, maxViewportOfNewPage?: boolean);
|
|
1131
|
+
apiContext(): LsdApiContext;
|
|
1070
1132
|
browser(): LsdBrowser;
|
|
1071
1133
|
close(): Promise<boolean>;
|
|
1072
1134
|
closeFreePages(maxPageFreeSeconds?: number): Promise<boolean>;
|
|
1073
1135
|
getPage(always?: boolean): Promise<LsdPage | null>;
|
|
1074
|
-
|
|
1136
|
+
hasFreePage(pageNum?: number): boolean;
|
|
1075
1137
|
id(): string;
|
|
1076
1138
|
isIncognito(): boolean;
|
|
1077
1139
|
page(pageIdx: number): LsdPage | null;
|
|
@@ -1084,7 +1146,7 @@ declare class PlaywrightBrowserContext extends EventEmitter implements LsdBrowse
|
|
|
1084
1146
|
declare class PlaywrightPage extends EventEmitter implements LsdPage {
|
|
1085
1147
|
#private;
|
|
1086
1148
|
constructor(browserContext: LsdBrowserContext, page: Page, pageInfo?: PageInfo);
|
|
1087
|
-
|
|
1149
|
+
apiContext(): LsdApiContext;
|
|
1088
1150
|
bringToFront(): Promise<boolean>;
|
|
1089
1151
|
browserContext(): LsdBrowserContext;
|
|
1090
1152
|
clearCookies(): Promise<boolean>;
|
|
@@ -1183,11 +1245,12 @@ declare class PuppeteerBrowser extends EventEmitter implements LsdBrowser {
|
|
|
1183
1245
|
declare class PuppeteerBrowserContext extends EventEmitter implements LsdBrowserContext {
|
|
1184
1246
|
#private;
|
|
1185
1247
|
constructor(lsdBrowser: LsdBrowser, browserContext: BrowserContext$1, incognito?: boolean, proxy?: ProxyInController | null, browserIdx?: number, browserContextIdx?: number, maxPagesPerBrowserContext?: number, maxPageFreeSeconds?: number, userAgent?: string, maxViewportOfNewPage?: boolean);
|
|
1248
|
+
apiContext(): LsdApiContext;
|
|
1186
1249
|
browser(): LsdBrowser;
|
|
1187
1250
|
close(): Promise<boolean>;
|
|
1188
1251
|
closeFreePages(maxPageFreeSeconds?: number): Promise<boolean>;
|
|
1189
1252
|
getPage(always?: boolean): Promise<LsdPage | null>;
|
|
1190
|
-
|
|
1253
|
+
hasFreePage(pageNum?: number): boolean;
|
|
1191
1254
|
id(): string;
|
|
1192
1255
|
isIncognito(): boolean;
|
|
1193
1256
|
page(pageIdx: number): LsdPage | null;
|
|
@@ -1200,7 +1263,7 @@ declare class PuppeteerBrowserContext extends EventEmitter implements LsdBrowser
|
|
|
1200
1263
|
declare class PuppeteerPage extends EventEmitter implements LsdPage {
|
|
1201
1264
|
#private;
|
|
1202
1265
|
constructor(browserContext: LsdBrowserContext, page: Page$1, pageInfo?: PageInfo);
|
|
1203
|
-
|
|
1266
|
+
apiContext(): LsdApiContext;
|
|
1204
1267
|
bringToFront(): Promise<boolean>;
|
|
1205
1268
|
browserContext(): LsdBrowserContext;
|
|
1206
1269
|
clearCookies(): Promise<boolean>;
|
|
@@ -1282,7 +1345,7 @@ declare class CheerioPage extends EventEmitter implements LsdPage {
|
|
|
1282
1345
|
*/
|
|
1283
1346
|
constructor(html?: string, isHtml?: boolean);
|
|
1284
1347
|
_origPage(): AllPage;
|
|
1285
|
-
|
|
1348
|
+
apiContext(): LsdApiContext;
|
|
1286
1349
|
bringToFront(): Promise<boolean>;
|
|
1287
1350
|
browserContext(): LsdBrowserContext;
|
|
1288
1351
|
clearCookies(): Promise<boolean>;
|
|
@@ -1360,8 +1423,8 @@ declare class LsdBrowserController implements LsdBrowserController$1 {
|
|
|
1360
1423
|
setPlaywrightBrowserType(browserType: LsdBrowserType, playwrightBrowserType: BrowserType | null): boolean;
|
|
1361
1424
|
launch(browserControllerType: BrowserControllerType, browserType: LsdBrowserType, options: LsdLaunchOptions): Promise<LsdBrowser>;
|
|
1362
1425
|
connect(browserControllerType: BrowserControllerType, browserType: LsdBrowserType, options: LsdConnectOptions): Promise<LsdBrowser>;
|
|
1363
|
-
|
|
1426
|
+
newApiContext(options?: LsdApiContextOptions): Promise<LsdApiContext>;
|
|
1364
1427
|
}
|
|
1365
1428
|
declare const controller: LsdBrowserController;
|
|
1366
1429
|
|
|
1367
|
-
export { type AllApiRequestContext, type AllBrowser, type AllBrowserContext, type AllFrame, type AllPage, type AllResponse, type BrowserControllerType, type BrowserCreationMethod, type BrowserLaunchMethod, type BrowserManager, type BrowserStateData, CheerioElement, type CheerioNode, CheerioPage, type CookieItem, type GotoOptions, type IframeOption, type InputOptions, type KeyInput, type KeyPressOptions, type LocalStorageItem, type LocalStorageOrigin, type LowerCasePaperFormat, type LsdBrowser, type LsdBrowserContext, type LsdBrowserContextOptions, type LsdBrowserController$1 as LsdBrowserController, type LsdBrowserType, type LsdConnectOptions, type LsdElement, type LsdLaunchOptions, type LsdPage, type MouseClickOptions, type MouseClickType, type NavigationWaitUntil, type PDFMargin, type PDFOptions, type PageEvent, type PageExtInPlaywright, type PageExtInPuppeteer, type PageInfo, type PageOpenType, type PageStatus, type PaperFormat, PlaywrightBrowser, PlaywrightBrowserContext, 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 };
|
|
1430
|
+
export { type AllApiRequestContext, type AllBrowser, type AllBrowserContext, type AllFrame, type AllPage, type AllResponse, type BrowserControllerType, type BrowserCreationMethod, type BrowserLaunchMethod, type BrowserManager, type BrowserStateData, CheerioElement, type CheerioNode, CheerioPage, type ClientCertificate, type CookieItem, 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, type LsdBrowserContextOptions, type LsdBrowserController$1 as LsdBrowserController, type LsdBrowserType, type LsdConnectOptions, type LsdElement, type LsdFetchOptions, type LsdLaunchOptions, type LsdPage, type MouseClickOptions, type MouseClickType, type NavigationWaitUntil, type PDFMargin, type PDFOptions, type PageEvent, type PageExtInPlaywright, type PageExtInPuppeteer, type PageInfo, type PageOpenType, type PageStatus, type PaperFormat, PlaywrightBrowser, PlaywrightBrowserContext, 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 };
|