Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_uie_webview (Read 73620 times) previous topic - next topic
0 Members and 10 Guests are viewing this topic.

Re: foo_uie_webview

Reply #550
Need some help with this ...

Code: [Select]
			console.log('isPlaying = ' + chrome.webview.hostObjects.sync.foo_uie_webview.GetFormattedText("%isplaying%"));
console.log('isPlaying2 = ' + chrome.webview.hostObjects.sync.foo_uie_webview.isPlaying);
console.log('isPaused = ' + chrome.webview.hostObjects.sync.foo_uie_webview.isPaused);
console.log('Component Version = ' + chrome.webview.hostObjects.sync.foo_uie_webview.componentVersionText);

  • First line works -- but only if the track is currently selected (cursor on it). It's working good, but not what I am looking for.
  • Second line always return false
  • Third line always return false
  • Fourth line returns the version 0.2.0.0. All good.

Is the ".isPlaying" property working?

I tried the other versions ".isplaying" and ".IsPlaying" ... all don't work...

.

Re: foo_uie_webview

Reply #551
Is the ".isPlaying" property working?

I tried the other versions ".isplaying" and ".IsPlaying" ... all don't work...
Thx. for reporting this. It used to work. I'll check ASAP.

Re: foo_uie_webview

Reply #552
The API of WebView2 does not support a binary interface besides simple datatypes (integer, string, boolean), at best arrays of those simple datatypes. I could create a 'cursor' API that can be called from JavaScript to handle large data sets but the marshalling will always be thru JSON (unless someone with more experience contradicts me now).
I'm going to agree with regor here that:
Quote
I don't think you really need to expose the actual internal data of handles at all. You can pass an object compatible with JSON just containing the same data found on SMP. i.e. Raw Path, path, subsong index, etc. All your methods would ingest that object, and the actual matching with tracks would be done internally by your component (being invisible to the web view code) -either by raw path + subsong or with some internal uuid-.
It'd be great if we had a useful JSON object that contained information we could use, but all we really need is a unique ID/rawpath+subsong/something that can be passed to some methods you create to run TF queries or get the information we actually want.

Having user scripts manage memory internally in the component is a PITA and kind of anti how JS should be written (although this obviously isn't normal JS), and so having ephemeral handle lists that are not guaranteed to be valid after the callback returns or whatever Query/Search methods you give us returns is perfectly fine, so long as the handleId that was returned can still be passed to a TF method to query it, and it just errors gracefully if the item has been removed from the user's library.

Re: foo_uie_webview

Reply #553
Is the ".isPlaying" property working?

I tried the other versions ".isplaying" and ".IsPlaying" ... all don't work...
Thx. for reporting this. It used to work. I'll check ASAP.
Yeah can verify this broke in alpha5. I'm sure it's the same root cause, but isMuted, canSeek and probably some others also always return false. Wonder if the coercion from 1/0 to true/false broke something.

Re: foo_uie_webview

Reply #554
foo_uie_webview v0.2.1.0

* Fixed: Misinterpreted true Booleans values. This caused various isXXX properties like isPlaying to stop working. (Regression)

You can download it from GitHub and from the Component repository.

Re: foo_uie_webview

Reply #555
Question, as far as I have seen, this could be run by your component, don't you?
https://github.com/webui-dev/deno-webui

So only thing needed is running the deno server manually, and you would have standard fs and network methods available.

Not suggesting you do that with your component by default, just curious about it being possible, since contrary to python/node servers... it's 100% portable and requires a single binary. So compatibility and installation is as hard as your component itself.

Also, in such case, would it be possible to add a method to run an executable + arguments? That would cover the need to run it manually. With it people could replace Biography panel, since you could fetch everything either with deno or just using curl (I think in this case additional network methods are still required for lookup).

Ideally async and sync versions should be provided, to do something when the process ends (even if output can not be read, you can send data to text files or images).

In SMP you can read output (async) with WScript.Shell.Exec and run (sync) with WScript.Shell.Run.

Re: foo_uie_webview

Reply #556
Question, as far as I have seen, this could be run by your component, don't you?
https://github.com/webui-dev/deno-webui

So only thing needed is running the deno server manually, and you would have standard fs and network methods available.

Not suggesting you do that with your component by default, just curious about it being possible, since contrary to python/node servers... it's 100% portable and requires a single binary. So compatibility and installation is as hard as your component itself.
I don't see why not. A web server is a web server.
Also, in such case, would it be possible to add a method to run an executable + arguments? That would cover the need to run it manually. With it people could replace Biography panel, since you could fetch everything either with deno or just using curl (I think in this case additional network methods are still required for lookup).
Should be possible since the process would be launched by fb2k. I'll see if I can get it in the next alpha.

Re: foo_uie_webview

Reply #557
I managed to do something by configuring a local server to receive data from the folders, in particular LastFM, but with great difficulty.

I also managed to open the text with notepad++ but with great difficulty.

I don't think it's feasible for the average user to explain that node.js must be installed, start the server and then use pm2 to start automatically when the operating system starts.

I see it as a very complex thing to explain.

Video LastFm data server + notepad++ open editor local file:

Server Test.

Re: foo_uie_webview

Reply #558
That's where Deno/Bun would fit seamlessly. Just a single executable, works on all OSes, zero settings needed, all filesystem/network methods are natively available. And would only require a single line of code for devs to run it whenever the method is added to the component.

Also managed to make Deno/Bun somewhat work on win 7 with this. No idea about wine though.

I agree node or python is a nope for most users. It's also a hell to maintain in the long term.

Quote
Should be possible since the process would be launched by fb2k. I'll see if I can get it in the next alpha.
Great :)

Re: foo_uie_webview

Reply #559
Quote
Should be possible since the process would be launched by fb2k. I'll see if I can get it in the next alpha.
Great :)
@regor

well, as I suspected it works and it was simple to implement.

However, I call on the community for input:

Great power can be used for good but also for evil. Any JavaScript can now execute() very dangerous commands, even with elevated rights (after a prompt).

At the very least I'm thinking of only enabling this command by an opt-in in the component preferences.

Any thoughts?

Re: foo_uie_webview

Reply #560
Any thoughts?
I think that's fine, as long as there is a method to check if that setting is already enabled. Would it be per panel or global switch?

For ex. let's say you name it as 'Full system access' in the preferences panel (it could also enable other future methods). Then we can do something like [...].IsFullSystemMode() within JS, and use that [if false] to throw a popup/message on the panel asking the user to enable it. It's secure by default, but also simple for the final user to understand what to do just by looking at the panel after installation (people usually don't read installation notes).

Re: foo_uie_webview

Reply #561
@yeyo On the Spin Disc I found another problem: the double click that applies the mask is not maintained when changing tracks.

Solved I hope.....

Spoiler (click to show/hide)
foorab for webview template,I updated the new version (Chinese only), the change log is as follows:
1. Adaptation: webview 0.2.1.0, template name: foorab-webview-v0.2.1.0-after.html
2. Rewrite: the logic of enabling, disabling, and automatic processing of the disc mask image, select it in the configuration for use (Double-click to enable or disable the feature removed)
3. Added: When the spectrum animation option is not checked, the extension of the currently playing audio track file is displayed, and the ico of the icons directory is called to display in the upper right corner
4. Fixed: When the playback is paused, the rotating disc still rotates

Re: foo_uie_webview

Reply #562
foorab for webview template,I updated the new version (Chinese only), the change log is as follows:
@yeyo

thanks for the update and your time but can you please post future updates in the "Made with foo_uie_webview" thread?

It will make your update easier to find and we can keep this thread about updates to the component itself.

Re: foo_uie_webview

Reply #563
@yeyo On the Spin Disc I found another problem: the double click that applies the mask is not maintained when changing tracks.

Solved I hope.....

Spoiler (click to show/hide)
foorab for webview template,I updated the new version (Chinese only), the change log is as follows:
1. Adaptation: webview 0.2.1.0, template name: foorab-webview-v0.2.1.0-after.html
2. Rewrite: the logic of enabling, disabling, and automatic processing of the disc mask image, select it in the configuration for use (Double-click to enable or disable the feature removed)
3. Added: When the spectrum animation option is not checked, the extension of the currently playing audio track file is displayed, and the ico of the icons directory is called to display in the upper right corner
4. Fixed: When the playback is paused, the rotating disc still rotates

Yes, thanks, I'm trying to make some changes and also understand the new set-up.

For today I'm stuck with these non-definitive changes.


Re: foo_uie_webview

Reply #564
When I setup a new webview, then right-click, it will show the "webview" menu option.



After I select "webview -> preferences" and select the template. All good.

Then if I want to change to another template, I right-click again, the "webview" menu is now gone. How do I get it back?



Re: foo_uie_webview

Reply #565
Small enhancement request -- if I run more than one instance of Webview, on the "Preferences: Webview" page -- to show which instance is being configured, and if it is possible to select the instance to configure.


Re: foo_uie_webview

Reply #566
Small enhancement request -- if I run more than one instance of Webview, on the "Preferences: Webview" page -- to show which instance is being configured
What do you think the Name field is for?
if it is possible to select the instance to configure.
That may be more difficult than it sounds... Not promising anything.

Re: foo_uie_webview

Reply #567
Then if I want to change to another template, I right-click again, the "webview" menu is now gone. How do I get it back?
The context menu of the underlying WebView2 is called and expanded. Make sure it is active by clicking on area of the control that accepts mouse clicks.

Re: foo_uie_webview

Reply #568
I have reached this point, and just modifying the box has been extremely demanding, there is no possibility of a third choice between Spectrum and Format management, that is, not showing either the Spectrum or the audio format icon.


Re: foo_uie_webview

Reply #569
What do you think the Name field is for?

Ahh ... i never used that field. Thanks for the tip!

if it is possible to select the instance to configure.
That may be more difficult than it sounds... Not promising anything.

Thanks for considering the enhancement request :)

The context menu of the underlying WebView2 is called and expanded. Make sure it is active by clicking on area of the control that accepts mouse clicks.

Thanks for the tip. Tried -- I really need to right-click all over the place ... success! It's a workable workaround for now.


Re: foo_uie_webview

Reply #571
Hi, I like your Webview and I'm working on getting the results I'd like.
I'm Italian and I apologize for my googled English

A warning: in the Default-PlaylistTemplate:
"chrome.webview.hostObjects.foo_uie_webview.getSelectedPlaylistItems(0);"
you always get the files of playlist 0, you would need an index of the selected playlist
getSelectedPlaylistItems(index)

A request: would it be possible to get events from the library as well?

Thank you for your work and... Happy Holidays

Re: foo_uie_webview

Reply #572
A warning: in the Default-PlaylistTemplate:
"chrome.webview.hostObjects.foo_uie_webview.getSelectedPlaylistItems(0);"
you always get the files of playlist 0, you would need an index of the selected playlist
getSelectedPlaylistItems(index)
... it was very easy, I copied from the Refresh() function:
"const Index = chrome.webview.hostObjects.sync.foo_uie_webview.activePlaylist;".

Another request: is it possible to get the "path" of the focusedPlaylistItem directly
without having to go through getPlaylistItems?
The playlist could contain thousands of music tracks...
bye

Re: foo_uie_webview

Reply #573
A warning: in the Default-PlaylistTemplate:
"chrome.webview.hostObjects.foo_uie_webview.getSelectedPlaylistItems(0);"
you always get the files of playlist 0, you would need an index of the selected playlist
getSelectedPlaylistItems(index)
... it was very easy, I copied from the Refresh() function:
"const Index = chrome.webview.hostObjects.sync.foo_uie_webview.activePlaylist;".
There's a synchronous and asynchronous version of the method.
Another request: is it possible to get the "path" of the focusedPlaylistItem directly
without having to go through getPlaylistItems?
The playlist could contain thousands of music tracks...
Not right now. The API has to be expanded.

Re: foo_uie_webview

Reply #574
When I setup a new webview, then right-click, it will show the "webview" menu option.

[attach width=300]34238[/attach]

After I select "webview -> preferences" and select the template. All good.

Then if I want to change to another template, I right-click again, the "webview" menu is now gone. How do I get it back?

[attach width=500]34240[/attach]
In my experience the issue is right clicking on images. If you're using a template whose whole background is an image, it might pose problems.