Code Monkey home page Code Monkey logo

Comments (4)

dunielpls avatar dunielpls commented on April 20, 2025 1

For anyone else looking into something similar, I grepped through parts of the Chromium source and it appears that the kiosk restrictions remain present even with both of the flags --kiosk and --no-startup-window - the only problem is that Chromium has no idea how to make a non-existent window full-screen.

To solve that I ended up opening a CDP session and getting the windowId with Browser.getWindowForTarget before requesting fullscreen with Browser.setWindowBounds (parameters {windowId, bounds: {windowState: "fullscreen"}}.

Despite solving my issue through a sort of workaround I still wonder why Playwright by default disallows arguments that do not start with a hyphen, i.e. opening a specific URL in the default context on startup.

from playwright.

dunielpls avatar dunielpls commented on April 20, 2025

It may also be desirable to allow setting an initial URL for non-persistent contexts too, i.e. making it possible to have the default context automatically navigate to a user-supplied URL when using launch.

This would require removing the --no-startup-window flag when isPersistent is false and appending the URL in question too.

from playwright.

yury-s avatar yury-s commented on April 20, 2025

This parameters you pass in launch/launchPersistentContext are fully customizable with a combination of ignoreDefaultArgs and args. We settled over time on the default arguments that we have today, they give you the most flexible control over the browser from the very beginning of the process run, there are no plans to change it.

from playwright.

dunielpls avatar dunielpls commented on April 20, 2025

That is nearly true - it isn't possible to 'specify page to be opened', which seems like a fairly arbitrary limitation.

if (args.find(arg => !arg.startsWith('-')))
throw new Error('Arguments can not specify page to be opened');

from playwright.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.