Skip to content

Commit

Permalink
Merge pull request #17 from Lctrs/patch-1
Browse files Browse the repository at this point in the history
Fix localStorage access not allowed on certain pages
  • Loading branch information
robertfausk authored Jun 26, 2020
2 parents 9377d09 + 145dfd0 commit 328d634
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/PantherDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ public function reset()
if ($history) {
$history->clear();
}
if ($this->client->getWebDriver() instanceof JavaScriptExecutor) {
if (
$this->client->getWebDriver() instanceof JavaScriptExecutor
&& !in_array($this->client->getCurrentURL(), ['', 'about:blank', 'data:,'], true)
) {
$this->executeScript('localStorage.clear();');
}
// not sure if we should also close all windows
Expand Down

0 comments on commit 328d634

Please sign in to comment.