It is currently April 18th, 2024, 7:55 am

PluginWebView - Make skin using web technology

Share and get help with Plugins and Addons
User avatar
tass_co
Posts: 511
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: PluginWebView - Make skin using web technology

Post by tass_co »

khanhas wrote: December 15th, 2021, 10:10 am
I don't know where am I doing wrong?
Can you help me?
Main file "MainC.html" - I made Clip.ini for Rainmeter
19-05-2022 20_34_57-.png
Clipboarder.zip
You do not have the required permissions to view the files attached to this post.
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
Yincognito
Rainmeter Sage
Posts: 7120
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: PluginWebView - Make skin using web technology

Post by Yincognito »

tass_co wrote: May 19th, 2022, 5:39 pm I don't know where am I doing wrong?
Can you help me?
Main file "MainC.html" - I made Clip.ini for Rainmeter

19-05-2022 20_34_57-.png
Clipboarder.zip
I didn't test the skin or the HTML / JS themselves since I don't plan to install the Clipboarder gadget, so I only looked at the HTML / JS code, but are you sure that DLL is properly integrated in your system so Javascript can use it? Other than that, are you sure using such DLLs / ActiveX are the best (or safe) way to approach this, or that you even need a webpage to achieve what you want?

Googling around tells me that using DLLs in Javascript requires some things to be properly set up and that the program that the DLL belongs to should correctly add it to the system before you can think of using some of the said DLL objects / methods (like the System object in your case, I reckon). My guess is that this is the root issue here: if the DLL stuff can't be referenced in the Javascript code, it would probably throw an error like you encountered, since it's not defined or "imported" anywhere else in the JS code. So, if you want to pursue this path forward, you should make sure JS has access to those DLL 'goodies', and only then use them in the code.

P.S. On the Rainmeter code side, I doubt that having an Update of 100 ms is the best idea when using the WebView2 plugin. I'd set the update to either -1 or some other very rare update rate, since the JS code and the webpage itself can do things just as fast or even faster than Rainmeter can anyway. Besides that, updating the skin / measure that's using the WebView2 plugin would not achieve anything in principle, other than flooding the update queue pointlessly, since once the webpage is given the control, all the variables and stuff that it uses are controlled from within the JS script. For example, in my skin I'm not updating any Rainmeter measure or meter apart from when the skin is loaded or it needs some redrawing in case it's made to take advantage of being scalable (and even in the latter case, it's better to let Rainmeter handle the Rainmeter part and the JS handle the web part, as updating and redrawing is quite expensive when recreating the WebView2 measure, especially if you do resource intesive stuff in the webpage in the first place).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
tass_co
Posts: 511
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: PluginWebView - Make skin using web technology

Post by tass_co »

Yincognito wrote: May 19th, 2022, 7:08 pm
I use an app called 8gadgetpack for only one gadget on the desktop.
We have a skin called Clipboard made by SilverAzide in Rainmeter, but it's not that advanced. (The plugin could not be developed because Brian left us.)
I have the clipboard gadget files, I'm looking for ways to somehow connect to rainmeter.
I was glad to see the topic, but I couldn't...
I have to find another solution...
Thanks
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
SilverAzide
Rainmeter Sage
Posts: 2602
Joined: March 23rd, 2015, 5:26 pm

Re: PluginWebView - Make skin using web technology

Post by SilverAzide »

tass_co wrote: May 19th, 2022, 7:46 pm I use an app called 8gadgetpack for only one gadget on the desktop.
We have a skin called Clipboard made by SilverAzide in Rainmeter, but it's not that advanced. (The plugin could not be developed because Brian left us.)
I have the clipboard gadget files, I'm looking for ways to somehow connect to rainmeter.
I was glad to see the topic, but I couldn't...
I have to find another solution...
Thanks
It has nothing to with Brian (I hope he's not gone!)... it is this: https://forum.rainmeter.net/viewtopic.php?t=20995. This is the only Rainmeter clipboard plugin I know of. The author appears to have deleted his github repo where the source code was posted, and has not been active on the Rainmeter forum since 2015. If someone wants to create another plugin, it would not be terribly difficult, but I don't want to be the one to do it...
Gadgets Wiki GitHub More Gadgets...
User avatar
tass_co
Posts: 511
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: PluginWebView - Make skin using web technology

Post by tass_co »

SilverAzide wrote: May 19th, 2022, 9:28 pm It has nothing to with Brian (I hope he's not gone!)...
Oops! Im so sorry. I think I got people mixed up :oops:

I thought it was the person on this page that made the plugin.
https://github.com/brianferguson/Clipboard.dll/
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
SilverAzide
Rainmeter Sage
Posts: 2602
Joined: March 23rd, 2015, 5:26 pm

Re: PluginWebView - Make skin using web technology

Post by SilverAzide »

tass_co wrote: May 19th, 2022, 9:36 pm Oops! Im so sorry. I think I got people mixed up :oops:

I thought it was the person on this page that made the plugin.
https://github.com/brianferguson/Clipboard.dll/
Whoa! I was not aware of this plugin! Nice find! And we know who to complain to if it doesn't work! ;)
Gadgets Wiki GitHub More Gadgets...
User avatar
tass_co
Posts: 511
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: PluginWebView - Make skin using web technology

Post by tass_co »

SilverAzide wrote: May 19th, 2022, 9:59 pm Whoa! I was not aware of this plugin! Nice find! And we know who to complain to if it doesn't work! ;)
I guess this plugin won't be enough for me to get what I want either :-(
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
Yincognito
Rainmeter Sage
Posts: 7120
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: PluginWebView - Make skin using web technology

Post by Yincognito »

tass_co wrote: May 19th, 2022, 7:46 pmI use an app called 8gadgetpack for only one gadget on the desktop. [...] I have the clipboard gadget files, I'm looking for ways to somehow connect to rainmeter.
tass_co wrote: May 19th, 2022, 10:23 pmI guess this plugin won't be enough for me to get what I want either :-(
Yep, I know it's about 8gadgetpack. That is the program which should 'register' the DLL in the system so that - if such capabilities do exist, that is - it can be used by other programming environments. Not sure if Javascript can use it, obviously, and Rainmeter needs a certain type of plugins, but you're free to investigate, though it might be a bit difficult. The other two mentioned by you and SilverAzide are Rainmeter plugins so they should be able to be used with Rainmeter, with or without the WebView plugin. If you want to do such things from Javascript in a WebView plugin powered webpage, maybe this or this could be good starting points (take care with CORS as it's a bitch, LOL, you'd have to run a local server - preferably triggered automatically from the skin itself via Node.js' http-server -a localhost -p 8080 -c-1 --cors like I do -, use http://localhost/ URLs and paths, and set some CORS flags to be hassle free when testing locally, even with ES6 modules). Also, since we're at it, like I mentioned earlier, most if not all of the Rainmeter mouse actions on the skins (like dragging, wheel actions, context menus), not to mention scaling and others, can be replicated in a WebView page via Javascript event listeners and some correlated usage of CSS custom properties and Rainmeter variables, so you'd end up with a skin that has a very similar feeling with one done exclusively in the native Rainmeter code.

Other than that, what exactly would you want that neither of these plugins are enough for the task? Just curious... :???:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
tass_co
Posts: 511
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: PluginWebView - Make skin using web technology

Post by tass_co »

What you mentioned above is very difficult for me. I'm newbie :Whistle
I have the files.I thought I could add it to Rainmeter somehow. I was wrong...
Yincognito wrote: May 20th, 2022, 1:40 am Other than that, what exactly would you want that neither of these plugins are enough for the task? Just curious... :???:
The gadget I mentioned has many nice features.Very useful. I don't want to be tied to a app for a single gadget.
https://8gadgetpack.net/gadgets/Features.html
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
Yincognito
Rainmeter Sage
Posts: 7120
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: PluginWebView - Make skin using web technology

Post by Yincognito »

tass_co wrote: May 20th, 2022, 5:38 am What you mentioned above is very difficult for me. I'm newbie :Whistle
I have the files.I thought I could add it to Rainmeter somehow. I was wrong...

The gadget I mentioned has many nice features.Very useful. I don't want to be tied to a app for a single gadget.
https://8gadgetpack.net/gadgets/Features.html
I understand. Well, you can't expect to just add stuff to something and then to magically work - usually some effort is required to get what you want. That being said, if you're only after the text contents of the clipboard, you can integrate the Get-Clipboard and Set-Clipboard commands from Powershell in a standard RunCommand measure, something that is pretty trivial to implement.
Manage Clipboard.jpg
Or, you can use the !SetClip bang from Rainmeter for setting the clipboard part.

If you need more than such basic abilities, you'd obviously have to explore other more complex avenues... :confused:
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth