From 71c242b36e92fe0fe3891b2700a41eb629b61550 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 22 Mar 2024 12:08:31 +0200 Subject: [PATCH] Don't iterate windows, when already at correct window (#24) --- src/WebdriverClassicDriver.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/WebdriverClassicDriver.php b/src/WebdriverClassicDriver.php index dd10e7e..eb532f4 100644 --- a/src/WebdriverClassicDriver.php +++ b/src/WebdriverClassicDriver.php @@ -1013,6 +1013,12 @@ private function mouseOverElement(RemoteWebElement $element): void */ private function withWindow(?string $name, callable $callback): void { + if ($name === null) { + $callback(); + + return; + } + $origName = $this->getWindowName(); try {