mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 11:57:33 +08:00
6
types/puppeteer/index.d.ts
vendored
6
types/puppeteer/index.d.ts
vendored
@@ -725,7 +725,7 @@ export interface FrameBase {
|
||||
): Promise<void>;
|
||||
waitForSelector(
|
||||
selector: string,
|
||||
options?: { visible: boolean; timeout: number }
|
||||
options?: { visible?: boolean; hidden?: boolean; timeout?: number }
|
||||
): Promise<void>;
|
||||
}
|
||||
|
||||
@@ -1148,6 +1148,10 @@ export interface LaunchOptions {
|
||||
args?: string[];
|
||||
/** Close chrome process on Ctrl-C. Defaults to true. */
|
||||
handleSIGINT?: boolean;
|
||||
/** Close chrome process on SIGTERM. Defaults to true. */
|
||||
handleSIGTERM?: boolean;
|
||||
/** Close chrome process on SIGHUP. Defaults to true. */
|
||||
handleSIGHUP?: boolean;
|
||||
/**
|
||||
* Maximum time in milliseconds to wait for the Chrome instance to start.
|
||||
* Defaults to 30000 (30 seconds). Pass 0 to disable timeout.
|
||||
|
||||
@@ -118,7 +118,7 @@ puppeteer.launch().then(async browser => {
|
||||
|
||||
let currentURL: string;
|
||||
page
|
||||
.waitForSelector("img")
|
||||
.waitForSelector("img", { visible: true })
|
||||
.then(() => console.log("First URL with image: " + currentURL));
|
||||
for (currentURL of [
|
||||
"https://example.com",
|
||||
@@ -160,7 +160,10 @@ puppeteer.launch().then(async browser => {
|
||||
args: [
|
||||
'--no-sandbox',
|
||||
'--disable-setuid-sandbox',
|
||||
]
|
||||
],
|
||||
handleSIGINT: true,
|
||||
handleSIGHUP: true,
|
||||
handleSIGTERM: true,
|
||||
});
|
||||
const page = await browser.newPage();
|
||||
await page.goto("https://example.com");
|
||||
|
||||
Reference in New Issue
Block a user