Skip to content

Commit 6dd4dae

Browse files
committed
Dynamic DevTools
1 parent a968651 commit 6dd4dae

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

src/Windows/Window.php

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class Window
3030

3131
protected bool $showDevTools = false;
3232

33+
protected bool $devToolsOpen = false;
34+
3335
protected bool $resizable = true;
3436

3537
protected bool $movable = true;
@@ -176,14 +178,36 @@ public function alwaysOnTop($alwaysOnTop = true): self
176178
return $this;
177179
}
178180

179-
public function showDevTools($showDevTools = true): self
181+
public function showDevTools(bool $showDevTools = true): self
180182
{
181183
$this->showDevTools = $showDevTools;
182184

185+
if (! $this instanceof PendingOpenWindow) {
186+
$this->client->post('window/show-dev-tools', [
187+
'id' => $this->id,
188+
]);
189+
}
190+
191+
return $this;
192+
}
193+
194+
public function hideDevTools(): self
195+
{
196+
if (! $this instanceof PendingOpenWindow) {
197+
$this->client->post('window/hide-dev-tools', [
198+
'id' => $this->id,
199+
]);
200+
}
201+
183202
return $this;
184203
}
185204

186-
public function resizable($resizable = true): static
205+
public function devToolsOpen(): bool
206+
{
207+
return $this->devToolsOpen;
208+
}
209+
210+
public function resizable(bool $resizable = true): static
187211
{
188212
$this->resizable = $resizable;
189213

0 commit comments

Comments
 (0)