Skip to content

Commit

Permalink
Allow getting window handle in W3C mode
Browse files Browse the repository at this point in the history
  • Loading branch information
aik099 committed Mar 19, 2024
1 parent 83b6840 commit de263e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/WebDriver/Window.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ public function __construct($url, $windowHandle = null)
public function getHandle()
{
if (! $this->windowHandle) {
$result = $this->curl('GET', $this->url);
$result = $this->curl('GET', '');

$this->windowHandle = array_key_exists(self::WEB_WINDOW_ID, $result['value'])
$this->windowHandle = is_array($result['value']) && array_key_exists(self::WEB_WINDOW_ID, $result['value'])
? $result['value'][self::WEB_WINDOW_ID]
: $result['value'];
}
Expand Down

0 comments on commit de263e5

Please sign in to comment.