Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1346

Community Plugins & Addons • Re: PluginWebView - Make skin using web technology

$
0
0
Hello everyone! I've decided to give this plugin a try but I've encountered an error. When trying to acess the RainmeterAPI from within JS I get an "Uncaught ReferenceError: RainmeterAPI is not defined" error. This even happens on the example skins. Has anyone encountered this?

Running Win11 23H2, so WebView comes preinstalled... maybe the plugin needs to be updated...
I'm facing the same problem and this strange workaround helps me. However, the problem seems to be back each time I restart Rainmeter or reload the particular skin.

Apparently there's something wrong with the order of the API being connected to WebView instance as it can't be reached only on the first load. I tried to solve the problem with the least effort by rebuilding the plugin from its source code with updated WebView dependencies but haven't got any results. Probably need to dive deeply into the programming...
As mentioned in my previous post, I was recently having the same issue as you both did. I had to spend some time on it, since MS is so helpful in making things hard for the user, but I eventually solved it by downgrading both Microsoft Edge AND Microsoft Edge WebView2 Runtime to the 100.0.1185.29 version. The only reason I chose this version was because I already had the Evergreen Standalone Offline Installer for that WebView Runtime version saved on my computer (125 MB, can't post it here), so the problem was finding the same Edge version (of course, you can try downgrading to some other version, e.g. the 109.0.1518.78 one, which is the last one supporting Windows 7, or any other where the Rainmeter API references work). Microsoft only had a close Beta version of Edge in its catalogues, so I finally found a "shady" (but helpful) site providing that Stable version of Edge for download, in a password protected archive, via googling "Edge 100 download".

Obviously, in order for such a thing to work, both the Edge and WebView Runtime need to be uninstalled first, which is not that easy to do without the WebView Runtime installer complaining that "a newer version of Edge is already installed on your system". In the end, I succeeded and now all things involving the Rainmeter API references in the Javascript code work. The other solution involves waiting for khanhas to react and update his plugin (if he'll ever do it), so this was quicker.

Catalogue of Microsoft Edge versions:
https://www.catalog.update.microsoft.com/Search.aspx?q=edge+stable
Catalogue of WebView Runtime versions:
https://www.catalog.update.microsoft.com/Search.aspx?q=edge-webview2+
Handle WebView reinstallation problems:
https://answers.microsoft.com/en-us/windows/forum/all/this-software-already-installed-on-your-system/8131f546-8d4a-40a6-a5ac-27c0b224d28d

Hopefully, this will be of some help for those experiencing the same issue with the Rainmeter API references when working with the WebView plugin.

P.S. By the way, just for reference to whatever other C++ developers (couch cough Brian cough) might tackle including WebView2 as a plugin for Rainmeter: https://github.com/MicrosoftEdge/WebView2Browser

Statistics: Posted by Yincognito — Today, 12:02 pm



Viewing all articles
Browse latest Browse all 1346

Trending Articles