Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: defaultViewport can be null in BrowserConnectOptions #6992

Closed
wants to merge 2 commits into from
Closed

fix: defaultViewport can be null in BrowserConnectOptions #6992

wants to merge 2 commits into from

Conversation

zoltan-boros
Copy link
Contributor

@zoltan-boros zoltan-boros commented Mar 15, 2021

Steps to reproduce

Description:

As per API defaultViewport field in launch options ( puppeteer.lauch( { defaultViewport: ... } ) link ) can have the three below values:

  • Viewport object - The specified viewport will be applied.
  • undefined (i.e. defaultViewport field is absent) - Default viewport will be applied.
  • null - No viewport will be applied. Useful in headful mode, because page content will accomodate to browser extent.

Tell us about your environment:

What steps will reproduce the problem?

  1. Create a TypeScript project that launches a Chromium instance using puppeteer.launch(options) function.
  2. Among options specify defaultViewport field as null.

Please include code that reproduces the issue.

puppeteer.lauch({
  headless: false,
  defaultViewport: null,
});

What is the expected result?

Code is accepted as valid, no type error raises.

What happens instead?

Type error raises, which tells that null is not valid value for defaultViewport.

@google-cla
Copy link

google-cla bot commented Mar 15, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Mar 15, 2021
@zoltan-boros
Copy link
Contributor Author

@googlebot I signed it!

@zoltan-boros zoltan-boros changed the title bugfix: defaultViewport can be null in BrowserConnectOptions fix: defaultViewport can be null in BrowserConnectOptions Mar 15, 2021
@sadym-chromium
Copy link
Collaborator

Could you please add more details? Ideally - open an issue justifying the need of the change.
What is the use-case when the defaultViewport is null?

@zoltan-boros
Copy link
Contributor Author

@sadym-chromium, thank you for the advice.
I added details.

@L0tso
Copy link

L0tso commented Mar 15, 2021

@sadym-chromium Another open pull request with linked issues #6942
Also, according to spec defaultViewport <?Object> Sets a consistent viewport for each page. Defaults to an 800x600 viewport. null disables the default viewport. null disables the default viewport.

@zoltan-boros
Copy link
Contributor Author

@sadym-chromium thank you for your review and approval.
I realized that #6942 is the proper fix of the same issue.
I would close this issue in favour of #6942. Could you review that one, please?

@zoltan-boros
Copy link
Contributor Author

Closed in favour of #6942

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants