Skip to content

Commit

Permalink
Merge pull request #899 from PHLAK/update-ignore-https
Browse files Browse the repository at this point in the history
Fixed `ignoreHttpsErrors()` method
  • Loading branch information
AlexVanderbist authored Nov 25, 2024
2 parents fb31c94 + 225c126 commit 3ff350c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bin/browser.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const callChrome = async pup => {
if (request.options.remoteInstanceUrl || request.options.browserWSEndpoint ) {
// default options
let options = {
ignoreHTTPSErrors: request.options.ignoreHttpsErrors
acceptInsecureCerts: request.options.acceptInsecureCerts
};

// choose only one method to connect to the browser instance
Expand All @@ -93,7 +93,7 @@ const callChrome = async pup => {
if (!browser) {
browser = await puppet.launch({
headless: request.options.newHeadless ? 'new' : true,
ignoreHTTPSErrors: request.options.ignoreHttpsErrors,
acceptInsecureCerts: request.options.acceptInsecureCerts,
executablePath: request.options.executablePath,
args: request.options.args || [],
pipe: request.options.pipe || false,
Expand Down
2 changes: 1 addition & 1 deletion src/Browsershot.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ public function setScreenshotType(string $type, ?int $quality = null): static

public function ignoreHttpsErrors(): static
{
return $this->setOption('ignoreHttpsErrors', true);
return $this->setOption('acceptInsecureCerts', true);
}

public function mobile(bool $mobile = true): static
Expand Down
2 changes: 1 addition & 1 deletion tests/BrowsershotTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
'url' => 'https://example.com',
'action' => 'screenshot',
'options' => [
'ignoreHttpsErrors' => true,
'acceptInsecureCerts' => true,
'path' => 'screenshot.png',
'viewport' => [
'width' => 800,
Expand Down

0 comments on commit 3ff350c

Please sign in to comment.