Modern HTML viewer plugin

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, Stefan2, white

User avatar
deus-ex
Power Member
Power Member
Posts: 907
Joined: 2003-02-10, 17:45 UTC

Re: Modern HTML viewer plugin

Post by *deus-ex »

rg_software wrote: 2022-11-08, 04:31 UTC The problem is that one of the users here mentioned EdgeViewer can be used to preview images in a folder. To do that I need to be able to view folders. To do that, I have to remove a detection string completely, as far as I understand.
HTMLViewer supports both viewings of folders including the thumbnail-display of images AND the detection string. Currently, I'm using a detection string to exclude XML-files from viewing, but I could do without it if that makes it easier for you to add support for viewing folders.
User avatar
petermad
Power Member
Power Member
Posts: 12196
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Re: Modern HTML viewer plugin

Post by *petermad »

2rg_software
To do that, I have to remove a detection string completely, as far as I understand.
I don't think so - my HTMLView shows folder content and has a detection string.
License #524 (1994)
Danish Total Commander Translator
TC 10.52 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.4.1.1022 (x64)
TC 3.40b5 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
rg_software
Junior Member
Junior Member
Posts: 53
Joined: 2009-08-06, 12:59 UTC

Re: Modern HTML viewer plugin

Post by *rg_software »

my HTMLView shows folder content and has a detection string
Well, okay, so the point is to exclude something rather than to include. That's valid use; in my case, however, I guess I'll only include something, and I can't include 'a folder' via a detection string as far as I can tell. If I have to check within a plugin that the entity is a folder, I can very well test for other valid extensions there.
User avatar
AntonyD
Senior Member
Senior Member
Posts: 436
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: Modern HTML viewer plugin

Post by *AntonyD »

2rg_software
Did not see your' answers/ideas about this:
Try to open MD file and .... dump. Cant' create WebView2. Code 203
Doesn't matter to me - why can't we continue further work, but generate a dump?
Falling down and dragging Total with itself?

IMHO IF - the real reason of this fall - is that on my system there is no INSTALLED edge - for such
"portable" cases you can imho easily provide version of your plugin which will have ALL essential dlls in some special subfolder
among all other installed staff. Thus if plugin could not detect installed version of WebView2 - it can use portable version...
#146217 personal license
User avatar
rg_software
Junior Member
Junior Member
Posts: 53
Joined: 2009-08-06, 12:59 UTC

Re: Modern HTML viewer plugin

Post by *rg_software »

Did not see your' answers/ideas about this:
- If something fails and I can detect it -- yes, naturally, I can implement graceful exit (report / close) instead of killing the whole TC process.

- On "portable version" -- frankly speaking, I am not sure. There is an official "fixed version" type of runtime that can be bundled with the app, but it would make the plugin huge. It might be worthy as an experiment.
User avatar
AntonyD
Senior Member
Senior Member
Posts: 436
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: Modern HTML viewer plugin

Post by *AntonyD »

2rg_software
Hello!
I fully understand that there may not be time for the full development of the product in our difficult time.
But still - at least a little can I ask - is there a chance to look at the moment that the plugin is launched on a system where there is no necessary run-time libs and it makes no sense to work without it - and you just need to calmly exit, and not fall|dump as it is happening now And do not drag the entire Total with itself. It turns out that even for tests now this plugin cannot be launched - because I afraid that something might fall.
Last edited by AntonyD on 2022-11-25, 07:59 UTC, edited 1 time in total.
#146217 personal license
User avatar
rg_software
Junior Member
Junior Member
Posts: 53
Joined: 2009-08-06, 12:59 UTC

Re: Modern HTML viewer plugin

Post by *rg_software »

Yes, I was going to do it actually earlier this week, but some unavoidable things have intervened. But I still have plans for the weekend :)
I'd appreciate help with testing, however, as I'll do my best to report properly, but I don't have relevant systems at hand (except 32-bit TC on a 64-bit system, which was reported as faulty earlier here).
User avatar
rg_software
Junior Member
Junior Member
Posts: 53
Joined: 2009-08-06, 12:59 UTC

Re: Modern HTML viewer plugin

Post by *rg_software »

Hi all,
I am going to publish a small update (more improvements to follow), and would appreciate if someone confirms the changes are OK. Here are the news:

- A combined 32/64-bit version.
- Errors when installing the 32-bit plugin ("This is not a valid plugin") should be gone.
- The ini file is now located in the plugin directory (the plugin won't overwrite it, so it isn't really important whether the location is read only).
- The temporary browser directory can be specified in the ini; environmental variables can be used in this path.
- Detection string is not used anymore. In particular, it means you can easily add/modify extensions in the ini file without uninstall/reinstall.
- The plugin should not crash upon errors anymore.
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 2850
Joined: 2003-05-06, 11:46 UTC

Re: Modern HTML viewer plugin

Post by *Sir_SiLvA »

I can confirm that 32bit Plugin doesnt crash anymore :-D
BUT now I have a folder
T:\TotalCmd\totalcmd.exe.WebView2\EBWebView\ (created by 32bit plugin)
And a folder
T:\TotalCmd\totalcmd64.exe.WebView2\EBWebView\ (created by 64bit Plugin) :-(

So for next release plase put EBWebView where it belongs -> Folder of the Plugin like the ini-file, thank you!

PS: UserDir=%COMMANDER_PATH%\PlugIns\Lister\EdgeViewer\ is ignored by the plugin.
User avatar
rg_software
Junior Member
Junior Member
Posts: 53
Joined: 2009-08-06, 12:59 UTC

Re: Modern HTML viewer plugin

Post by *rg_software »

Nope, it cannot be the "plugin folder", e.g., on my machine plugins are in C:\Program Files\TotalCommander\Plugins, so it is write protected.
So it means we must investigate why it fails.
Could you try a different UserDir, please? Maybe without env variables to rule out this possible error.
And pls confirm that %COMMANDER_PATH% is indeed not empty.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 5402
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Modern HTML viewer plugin

Post by *Horst.Epp »

Thanks for the update, it works fine here.

The following ini file entry works for me:
UserDir=%COMMANDER_PATH%\PlugIns\EdgeViewer\

As a result I only have one EBWebView under
C:\Tools\Wincmd\PLUGINS\EdgeViewer\EBWebView\
Windows 11 Home x64 Version 22H2 (OS Build 22621.900)
TC 10.52 x64 / x86
Everything 1.5.0.1331a (x64)
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 2850
Joined: 2003-05-06, 11:46 UTC

Re: Modern HTML viewer plugin

Post by *Sir_SiLvA »

Horst.Epp wrote: 2022-11-27, 09:18 UTC Thanks for the update, it works fine here.
dunno, probably forgot a restart yesterday :cry: but as Host wrote it works as it should.
BUT the plugin doesnt support Lister Hotkeys (yet? :)). For example in HTMLView I can press the key 4 to switch to EdgeViewer but not back.

Also, please try to reduce the "cache" this plugin creates.
When I watch about_box.htm (from totalcmd.chm) - 1.180 Bytes - with EdgeViewer I get an EBWebView-Folder that is 9.101.214 Bytes big:!:

Step to get the folders %COMMANDER_PATH%\totalcmd.exe.WebView2\EBWebView\ (created by 32bit plugin) and %COMMANDER_PATH%\totalcmd64.exe.WebView2\EBWebView\ (created by 64bit Plugin) in %Commander_Path%:
1. Edit edgeviewer.ini
2. Put a ; in front of UserDir=...
3. Save edgeviewer.ini
4. Restart TC
5. Use Lister with EdgeViewer
User avatar
petermad
Power Member
Power Member
Posts: 12196
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Re: Modern HTML viewer plugin

Post by *petermad »

I can confirm all of these works as expected:
- A combined 32/64-bit version.
- Errors when installing the 32-bit plugin ("This is not a valid plugin") should be gone.
- The ini file is now located in the plugin directory (the plugin won't overwrite it, so it isn't really important whether the location is read only).
- The temporary browser directory can be specified in the ini; environmental variables can be used in this path.
- Detection string is not used anymore. In particular, it means you can easily add/modify extensions in the ini file without uninstall/reinstall.
I am not sure which ini file you are referring to? is it the edgeviewer.ini or the wincmd.ini file ([ListerPlugins] section) ?
License #524 (1994)
Danish Total Commander Translator
TC 10.52 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.4.1.1022 (x64)
TC 3.40b5 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
rg_software
Junior Member
Junior Member
Posts: 53
Joined: 2009-08-06, 12:59 UTC

Re: Modern HTML viewer plugin

Post by *rg_software »

BUT the plugin doesnt support Lister Hotkeys (yet?)
Yet... will fix it in the next release (within this week, hopefully)
Also, please try to reduce the "cache" this plugin creates.
I am afraid this is completely beyond my control. It is a Chromium cache, so unless you have any specific ideas... sorry :)
Step to get the folders %COMMANDER_PATH%\totalcmd.exe.WebView2\EBWebView\
Right, UserDir is compulsory. Perhaps, I should give it a fallback location.
I am not sure which ini file you are referring to? is it the edgeviewer.ini or the wincmd.ini file
I am talking about edgeviewer.ini

For example, if you want to open txt files with it, just add TXT to the "HTML=" parameter under [Extensions].
User avatar
AntonyD
Senior Member
Senior Member
Posts: 436
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: Modern HTML viewer plugin

Post by *AntonyD »

2rg_software
"Detection string is not used anymore."
I don't understand what is the benefit of that? When a user installs this plug-in, by default he should receive some kind of guaranteed support for opening a set of some extensions. And this is guaranteed by the support of this DETECT-string. If it doesn't exist now, then what? Will the user have to immediately and without alternative go into the INI-settings file in order to enter the necessary extensions there? And is it any more convenient than it was? I HIGHLY suggest returning support for this DETECT-string and filling it with real extensions that the plugin can correctly open.

And further. Yes, the plugin no longer crashes and breaks the Total itself, correctly returns control to the plugin that was before.
BUT!!! Showing a window stating that it is not possible to create a window with "WebView2" class is left. BUT it still does not carry any benefit for the user((( It would be much better if links to some help on solving this problem appeared in this dialog. If there is a site where the necessary run-time libraries are posted, then mention the path to it in this dlg, for ex.
But it would be better to indicate these paths IMMEDIATELY in the TXT description of the plugin, so that the user can immediately download everything they need and install it on the computer even before installing and using the plugin. And yes - try to deal with the situation when people use only portable versions of the EDGE browser, which, in theory, already has all the necessary libraries in the unpacking folders, you just need to somehow reuse the necessary paths from there to use them in the plugin.
#146217 personal license
Post Reply