From 145dfd06bcc648aa3141d75c93ca6ea42bee9235 Mon Sep 17 00:00:00 2001 From: Lctrs Date: Fri, 26 Jun 2020 16:35:45 +0200 Subject: [PATCH] Fix localStorage access not allowed on certain pages --- src/PantherDriver.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/PantherDriver.php b/src/PantherDriver.php index 1b6f822..ca559fb 100644 --- a/src/PantherDriver.php +++ b/src/PantherDriver.php @@ -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