fix(typescript): allow defaultViewport to be 'null' (#6942)

Fixes: #6885

Co-authored-by: Maksim Sadym <69349599+sadym-chromium@users.noreply.github.com>
This commit is contained in:
Christian Bromann 2021-03-24 12:14:06 +01:00 committed by GitHub
parent c62b02f177
commit e31e68dfa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -184,7 +184,7 @@ export class Browser extends EventEmitter {
connection: Connection,
contextIds: string[],
ignoreHTTPSErrors: boolean,
defaultViewport?: Viewport,
defaultViewport?: Viewport | null,
process?: ChildProcess,
closeCallback?: BrowserCloseCallback
): Promise<Browser> {
@ -200,7 +200,7 @@ export class Browser extends EventEmitter {
return browser;
}
private _ignoreHTTPSErrors: boolean;
private _defaultViewport?: Viewport;
private _defaultViewport?: Viewport | null;
private _process?: ChildProcess;
private _connection: Connection;
private _closeCallback: BrowserCloseCallback;
@ -219,7 +219,7 @@ export class Browser extends EventEmitter {
connection: Connection,
contextIds: string[],
ignoreHTTPSErrors: boolean,
defaultViewport?: Viewport,
defaultViewport?: Viewport | null,
process?: ChildProcess,
closeCallback?: BrowserCloseCallback
) {

View File

@ -37,7 +37,7 @@ export interface BrowserConnectOptions {
/**
* Sets the viewport for each page.
*/
defaultViewport?: Viewport;
defaultViewport?: Viewport | null;
/**
* Slows down Puppeteer operations by the specified amount of milliseconds to
* aid debugging.