This simple widget embeds a web page full-screen into the openHAB UI.
Please note that the widget is unable to resize on screen orientation change, you need to reopen or reload the page.
To use the fullscreen web view, create a new layout page, add this widget as the only widget to that page. Set the URL property and you are nearly finished.
Finally, make sure that the web page you try to embed allows embedding (CORS policy):
for other applications: they probably have such a configuration option as well
else: put your web application behind a reverse proxy (e.g. nginx) and set the Access-Control-Allow-Origin header (help: Access-Control-Allow-Origin - HTTP | MDN)
Nice, I use the oh-webframe for this, but that doesn’t read the style object so styling is less trivial. I hadn’t thought to just skip right to the iframe…
If you just use the f7 variables instead of the screen object it is responsive to orientation changes
Correct. If I use this widget on different pages (normal layout page, tabbed layout page) on different devices, your solution unfortunately doesn‘t size correctly size on all of them. The screen object is in benefit here, since it is reading the DOM to get the height & width (note that the screen object in expressions is not exactly the same as the one from the browser API).
But I think it could be possible to make height and width available as css variables.