RemoteWebViewClient icon indicating copy to clipboard operation
RemoteWebViewClient copied to clipboard

Display Scaling

Open RyanEwen opened this issue 1 year ago • 8 comments

Is it possible to somehow scale the web page shown on a device? For example, with the ESP32-8048S043, everything is very small (mostly due to it being stuck in landscape mode at the moment). I was thinking I could use it in landscape but it would save a lot of messing with my HA dashboard if I could tell the remote webview to scale the page so that it is larger.

RyanEwen avatar Nov 01 '25 19:11 RyanEwen

I've already tried implementing scaling, but with no luck — nothing worked as needed. I may try again at some point (perhaps by switching to Chrome, if that works), but there's nothing I can do now.

strange-v avatar Nov 02 '25 10:11 strange-v

I've already tried implementing scaling, but with no luck — nothing worked as needed. I may try again at some point (perhaps by switching to Chrome, if that works), but there's nothing I can do now.

Does anything scaling wise happen when you use the '--force-device-scale-factor=1.5' parameter for the server?

Also it seems that for Puppet (the add-on that makes screenshots of a webpage and serves it as image) they have found a way doing this using built in Chromium: https://github.com/search?q=repo%3Aballoob%2Fhome-assistant-addons%20zoom&type=code

Heronimonimo avatar Dec 02 '25 14:12 Heronimonimo

Another option would be to add playwright-zoom to get it working with the current setup using playwright: https://github.com/dszendrei/playwright-zoom

Heronimonimo avatar Dec 02 '25 15:12 Heronimonimo

AFAIR, there was no effect at all from adding --force-device-scale-factor=1.5. playwright-zoom looks interesting, thanks.

The switching to Chrome idea is also to solve another issue: https://github.com/strange-v/RemoteWebViewServer/issues/4

strange-v avatar Dec 02 '25 15:12 strange-v

AFAIR, there was no effect at all from adding --force-device-scale-factor=1.5. playwright-zoom looks interesting, thanks.

The switching to Chrome idea is also to solve another issue: strange-v/RemoteWebViewServer#4

And for HA users Chromium seems to be built in, so it might also fix the backup size issue if you use a similar config like the Puppet Add-on uses.

But the playwright-zoom route might be the faster one to implement for now.

Heronimonimo avatar Dec 02 '25 15:12 Heronimonimo

Just to clarify this part:

And for HA users Chromium seems to be built in…

Home Assistant itself does not provide Chromium to add-ons. Each add-on runs in its own Docker image. The reason the Puppet add-on can avoid downloading an extra browser is simply because its own base image already includes Chromium, and Puppeteer is configured to use that instead of fetching another copy. This doesn’t mean Chromium is shared with the HA core or with other add-ons.

In RWV’s case, fixing backup size would only involve reducing what gets stored in /data (or other folder it backs up).

I don’t plan to work on RWV in the next few months, but I’m happy to review a PR if someone implements a fix/improvement without breaking the existing functionality.

strange-v avatar Dec 02 '25 16:12 strange-v

Added in the release 1.3.0.

strange-v avatar Oct 10 '26 15:10 strange-v

Added in the release 1.3.0.

Finally got to trying this and wanted to report that it works great!

RyanEwen avatar Nov 18 '26 16:11 RyanEwen