Skip to content

Allow passing options directly to Puppeteer's Page.screenshot() function #20

Open
@jerboa88

Description

@jerboa88

Remove quality and optimizeForSpeed from the main options object and allow them to be passed to Puppeteer's Page.screenshot(), along with other options, like so:

setDefaultOptions({
  puppeteer: {
    screenshot: {
      quality: 95,
      optimizeForSpeed: true,
      omitBackground: true,
      // ...
    },
    // ...
  },
  // ...
})

Because quality and optimizeForSpeed options are specific to image generation and are not used for any other purpose in the generation code, it makes sense to remove them from the main options object. Allowing arbitrary options to be passed will give user's more flexibility in case they need to customize the behavior of Page.screenshot() for their use case.

Options important for correct behavior of the plugin like path, clip and type should overwrite user-provided options.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✨ featureTYPE: An enhancement or a new feature

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions