Skip to content

[feature] Better screen viewport size handling - settings in app etc #3142

@dgtlmoon

Description

@dgtlmoon

The viewport settings kind of suck a bit, having to rely on the window-size settings in the docker environment is not really a nice solution

I'm thinking to add a selection in the settings to chose mobile/desktop common sizes.

Also add extra custom sizes

The app should pass the preferred size to the page fetcher, settings can be for now on main-settings and watch-settings

Even tho --window-size=1280.... is sent to the chrome browser it's not necessarily the same as the viewport

Fetchers ;

BrowserSteps and Playwright

They can have the viewport set in the browser new_context, this seems to work

            context = browser.new_context(
...
                viewport={'width': 1280, 'height': 1024}
            )
PyPuppeteer / faster fetching

Simply needs

self.page = (pages := await browser.pages) and len(pages) or await browser.newPage()
await self.page.setViewport({'width': 1280, 'height': 1024})
Selenium

Probably works with

options.add_argument("--window-size=1280,1024")
self.driver.set_window_size(1280, 1024)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions