Skip to content

Commit

Permalink
Merge branch 'master' of github.com:spatie/browsershot
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Jul 5, 2017
2 parents 0d05f1b + 175fa47 commit 69afd4e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Browsershot.php
Expand Up @@ -142,30 +142,30 @@ public function applyManipulations(string $imagePath)

public function createScreenshotCommand(string $workingDirectory): string
{
$command = "cd "
. escapeshellarg($workingDirectory)
. ";"
. escapeshellarg($this->findChrome())
. " --headless --screenshot "
. escapeshellarg($this->url);
$command = 'cd '
.escapeshellarg($workingDirectory)
.';'
.escapeshellarg($this->findChrome())
.' --headless --screenshot '
.escapeshellarg($this->url);

if ($this->disableGpu) {
$command .= ' --disable-gpu';
}

if ($this->windowWidth > 0) {
$command .= " --window-size="
. escapeshellarg($this->windowWidth)
. ","
. escapeshellarg($this->windowHeight);
$command .= ' --window-size='
.escapeshellarg($this->windowWidth)
.','
.escapeshellarg($this->windowHeight);
}

if ($this->hideScrollbars) {
$command .= ' --hide-scrollbars';
}

if (!empty($this->userAgent)) {
$command .= " --user-agent=" . escapeshellarg($this->userAgent);
if (! empty($this->userAgent)) {
$command .= ' --user-agent='.escapeshellarg($this->userAgent);
}

return $command;
Expand Down

0 comments on commit 69afd4e

Please sign in to comment.