Skip to content

Commit 35c8c2e

Browse files
authored
refactor: remove safeMode because Broweserless got rid of it (#22)
Browserless 2.0 /pdf API The PDF API operates in a similar fashion as the in browserless 1.xx. The biggest difference is how launch flags are handled, which now use a consolidated launch object to hold all CLI arguments and flags. waitFor has now been removed and deprecated in favor of puppeteer's discrete API methods: waitForEvent, waitForFunction, waitForSelector and waitForTimeout. rotate has been removed due to lack of usage and included 3rd party dependencies. safeMode has also been removed in favor of using puppeteer's streaming capabilities that are much less error-prone.
1 parent 7861e0c commit 35c8c2e

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

src/Browserless.php

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ class Browserless extends AbstractPDF
1616
*/
1717
private $pdfEndpoint = '/pdf';
1818

19-
/**
20-
* @var bool
21-
*/
22-
private $safeMode = false;
2319
/**
2420
* @var int|null
2521
*/
@@ -41,19 +37,6 @@ public function setRotation(?int $rotation = null): self
4137
return $this;
4238
}
4339

44-
/**
45-
* Sets whether or not to ask Browserless to attempt to render the document in safe mode
46-
*
47-
* @link https://docs.browserless.io/docs/pdf.html#safemode
48-
* @param bool $safeMode
49-
* @return self
50-
*/
51-
public function setSafeMode(bool $safeMode): self
52-
{
53-
$this->safeMode = $safeMode;
54-
return $this;
55-
}
56-
5740
/**
5841
* Sets the maximum time the PDF renderer should be prepared to spend rendering
5942
*
@@ -76,16 +59,6 @@ public function getTimeout(): ?int
7659
return $this->timeout;
7760
}
7861

79-
/**
80-
* Whether the document will be rendered in safe mode or not
81-
*
82-
* @return bool
83-
*/
84-
public function getSafeMode(): bool
85-
{
86-
return $this->safeMode;
87-
}
88-
8962
/**
9063
* Gets the documents rotation angle in degrees
9164
*
@@ -151,7 +124,6 @@ public function getFormattedOptions(): array
151124

152125
$options = [
153126
'options' => $pdfOptions,
154-
'safeMode' => $this->getSafeMode(),
155127
];
156128

157129
$goto = [];

0 commit comments

Comments
 (0)