injecting Javascripts within Widgets is possible - but not natively supported by openHAB and therefore not robustly working:
“The ability to to do this is a side-effect of the widget system not an intentional feature. So, it is not officially supported and there’s every likelihood that errors like this will crop up”
Is there any chance to enable “Javascripting within Widgets” in one of the next openHAB releases?
I am not familiar with the weather widget, but I don’t see any reason why you shouldn’t be able to make it work with a little bit of tweaking.
As for official support, you are welcome to put in a feature request on the Ui repository (or even propose and implement some PR that achieves what you are looking for), but I don’t think you’ll get what you’re after; there are just too many potential pitfalls for novice users to allow easy access to arbitrary code execution. In fact, a few recent changes have been made to limit some of the js in widget possibilities for security reasons. Those changes should not prevent you from running locally hosted js scripts (which is the work you would have to put in to getting the weather widget to run, I suspect).
Also, if you are comfortable with web server configuration it is possible for you to override the recent changes and allow OH to run scripts from other servers such as your weather script. But, this comes back around to there not being “official” support for such an action. It makes sense that this kind of activity needs to require a certain level of experience and understanding because the user who does this has to know and accept the risks for themselves.
thx. Saved the Widget-JS locally at html-share and changed the respective URL to “/static/libs/widget.min.js”.
No improvement - sometimes the widget is loaded properly, sometimes not.