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

General Discussion • Re: HTML & Meta Information Audio/Video Files

$
0
0
I told you CORS is a b*tch... :D

Anyway, if you want to pass a string that you manually input in HTML to a Javascript function, see:
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_text_get

If you want to pass a string from your skin's .ini to Javascript, that's not directly possible from the .ini, but it is possible from Javascript, via the WebView plugin's RainmeterAPI object and its .GetVariable() method:
https://github.com/khanhas/PluginWebView?tab=readme-ov-file#rainmeterapi

If you want to save or load stuff internally in Javascript, see:
https://www.w3schools.com/jsref/prop_win_localstorage.asp
which you can use with JSON.parse() and JSON.stringify() too:
https://www.w3schools.com/jsref/jsref_obj_json.asp

If you want to read a local text file in Javascript, see:
https://stackoverflow.com/questions/14446447/how-to-read-a-local-text-file-in-the-browser

As for using local paths in Javascript, that is almost always subject to CORS aka 'security reasons'. There are only a few exceptions to that. Yep, it drives most folks crazy, and it was the main inconvenient when I wrote my WebView skin too, and the reason for two additional dependencies besides the usual Rainmeter, WebView plugin and WebView runtime, in order to start a local server and use the http://localhost:8080/ prefix for files. I already hated excessive dependencies, you can imagine having even more than I originally expected. :twisted:

Statistics: Posted by Yincognito — Today, 12:30 am



Viewing all articles
Browse latest Browse all 1489

Trending Articles