Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsSteensma committed Aug 11, 2024
1 parent 5dde49c commit b2abad2
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ And then execute:

$ bundle update

Install puppeteer in your application's root directory:
Install puppeteer or puppeteer-core are supported in your application's root directory:

$ npm install puppeteer
$ npm install puppeteer
or
$ npm install puppeteer-core

<sub>Dhalang and Puppeteer require Node ≥ 18 and Puppeteer ≥ 22</sub>
## Usage
Expand Down Expand Up @@ -86,19 +88,10 @@ A list of all possible screenshot options that can be set, can be found at: http
>
> For example: `Dhalang::PDF.get_from_url("https://www.google.com", {headerTemplateFile: '/tmp/header.html', footerTemplateFile: '/tmp/footer.html'})`

## Custom user options
You may want to change the way Dhalang interacts with Puppeteer in general. User options can be set by providing them in a hash as last argument to any calls you make to the library. Are you setting both custom PDF and user options? Then they should be passed as a single hash.

For example to set a custom navigation timeout:
```ruby
Dhalang::Screenshot.get_from_url("https://www.google.com", :jpeg, {navigationTimeout: 20000})
```

Below table lists all possible configuration parameters that can be set:
Below table lists a more configuration parameters that can be set:
| Key | Description | Default |
|--------------------|-----------------------------------------------------------------------------------------|---------------------------------|
| browserWebsocketUrl | Websocket url of remote chromium browser to use
| browserWebsocketUrl | Websocket url of remote chromium browser to use | None |
| navigationTimeout | Amount of milliseconds until Puppeteer while timeout when navigating to the given page | 10000 |
| printToPDFTimeout | Amount of milliseconds until Puppeteer while timeout when calling Page.printToPDF | 0 (unlimited) |
| navigationWaitForSelector | If set, Dhalang will wait for the specified selector to appear before creating the screenshot or PDF | None |
Expand Down

0 comments on commit b2abad2

Please sign in to comment.