<p dir="auto">to simple windows-maxsize -&gt; page.windows_maxmize()  like selenium;</p>
<p dir="auto">Selenium feature: <a href="https://www.selenium.dev/selenium/docs/api/py/webdriver_remote/selenium.webdriver.remote.webdriver.html#selenium.webdriver.remote.webdriver.WebDriver.maximize_window" rel="nofollow">https://www.selenium.dev/selenium/docs/api/py/webdriver_remote/selenium.webdriver.remote.webdriver.html#selenium.webdriver.remote.webdriver.WebDriver.maximize_window</a></p>
<p dir="auto">Requested via Slack.</p>
<p dir="auto">Scenario: Automate a website and then let the user complete something. Its great if the max possible width/height could be determined so the user has "maximum available viewport".</p>
<p dir="auto">But not sure how or if its easy implementable since we in CR e.g. emulate the viewport independent from the window size.</p>
<p dir="auto">For Chromium it works already like that:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// @ts-check
const playwright = require('playwright');

(async () =&gt; {
    const browser = await playwright.chromium.launch({
      args: [&quot;--start-maximized&quot;],
      headless: false,
    });
    const context = await browser.newContext({
      viewport: null
    });
    const page = await context.newPage();
    await page.goto('http://whatsmyuseragent.org/');
    await browser.close();
})();"><pre class="notranslate"><span class="pl-c">// <span class="pl-k">@ts</span>-check</span>
<span class="pl-k">const</span> <span class="pl-s1">playwright</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'playwright'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">const</span> <span class="pl-s1">browser</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">playwright</span><span class="pl-kos">.</span><span class="pl-c1">chromium</span><span class="pl-kos">.</span><span class="pl-en">launch</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
      <span class="pl-c1">args</span>: <span class="pl-kos">[</span><span class="pl-s">"--start-maximized"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
      <span class="pl-c1">headless</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">const</span> <span class="pl-s1">context</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">browser</span><span class="pl-kos">.</span><span class="pl-en">newContext</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
      <span class="pl-c1">viewport</span>: <span class="pl-c1">null</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">const</span> <span class="pl-s1">page</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">context</span><span class="pl-kos">.</span><span class="pl-en">newPage</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">'http://whatsmyuseragent.org/'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">await</span> <span class="pl-s1">browser</span><span class="pl-kos">.</span><span class="pl-en">close</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>