EdgeViewer - Modern HTML viewer plugin

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
rg_software
Member
Member
Posts: 113
Joined: 2009-08-06, 12:59 UTC
Location: Aizu-Wakamatsu, Japan

Re: Modern HTML viewer plugin

Post by *rg_software »

I HIGHLY suggest returning support for this DETECT-string and filling it with real extensions that the plugin can correctly open.
Well, I thought about it for a while, really, it wasn't a random decision on a whim.

INI file is an integral part of the plugin, so "ini isn't there" is not an option, it's the same as "wlx isn't there". Ini file comes with a predefined set of supported extensions, and you can easily add or modify it. If you don't want to do it, just don't.

The main (or the only?) point of a detect string is to speed up TC a bit: TC checks whether a file is supported using the string, then loads the plugin. If the detect string is empty, it will simply try using the plugin in any case (and the plugin will check whether this extension is supported).

There are two downsides here, though. First, if you want to add a new file type, you'll have to do it twice -- in the main ini file and in the detect string. Second, AFAIK a detect string can't accept directories as an input file type (and this was requested).
BUT!!! Showing a window stating that it is not possible to create a window with "WebView2" class is left.
There are two error messages. One ("Cannot create WebView2. Error code: blabla") is mine, I can fix that. Another one (don't remember what it says exactly) is shown by Edge itself, and I can't change it AFAIK.
try to deal with the situation when people use only portable versions of the EDGE browser,
Well, again, please understand that in this situation we can only rely on MS-supplied functionality. I will add more information into Readme, and I might make a fully standalone version of the plugin. Note, however, that the standalone Edge for each processor architecture is ~200MB zipped (~400MB unzipped, almost 1GB in total if you want to have both 32 and 64 versions).
User avatar
AntonyD
Power Member
Power Member
Posts: 1231
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: Modern HTML viewer plugin

Post by *AntonyD »

Another one
There is NO another :) Only one = your's.
Note, however, that the standalone Edge for each processor architecture is ~200MB zipped (~400MB unzipped, almost 1GB in total if you want to have both 32 and 64 versions).
Did not catch the idea. I said - that I ALREADY have all essential dll's - but the only thing is that there are placing in some portable location,
so your plugin's core can't use simple call to the system like "Hey! Be so kind & create for me an instance of WebView2 class, pls."
We just have to setup the plugins' core in some manner - that it will start know that for proper creating on this class object it has to load firstly some essential dll's which can be found at path: ....
INI file is an integral part of the plugin
If this file ALWAYS will contain ALL extensions and folders - on which this plugin can be use - when it's fine.
#146217 personal license
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6449
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Modern HTML viewer plugin

Post by *Horst.Epp »

AntonyD wrote: 2022-11-27, 16:27 UTC
Note, however, that the standalone Edge for each processor architecture is ~200MB zipped (~400MB unzipped, almost 1GB in total if you want to have both 32 and 64 versions).
Did not catch the idea. I said - that I ALREADY have all essential dll's - but the only thing is that there are placing in some portable location,
so your plugin's core can't use simple call to the system like "Hey! Be so kind & create for me an instance of WebView2 class, pls."
We just have to setup the plugins' core in some manner - that it will start know that for proper creating on this class object it has to load firstly some essential dll's which can be found at path: ....
You assume your portable config which is not what typical users may have.
So the Author is right and he will get complains from users
which don't know such details and don't have the necessary files.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
rg_software
Member
Member
Posts: 113
Joined: 2009-08-06, 12:59 UTC
Location: Aizu-Wakamatsu, Japan

Re: Modern HTML viewer plugin

Post by *rg_software »

Did not catch the idea. I said - that I ALREADY have all essential dll's
I will check but I doubt it is doable.
You have a portable Edge setup -- that's good, but WebView2 is a different thing even if it's based on the same foundation.
At least, in MS docs they are treated separately, so in your case you'll have to have DLLs from a package "Microsoft WebView2 FixedVersionRuntime", not "MS Edge".
User avatar
AntonyD
Power Member
Power Member
Posts: 1231
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: Modern HTML viewer plugin

Post by *AntonyD »

2Horst.Epp
And you did get get my ideas. I am talking that ONLY and IF end-user knows that his portable the "Edge" installations is suitable for using from inside this plugin - AND IF the plugins' core will be able to work with such portable setup - then he can manipulate with some INI settings in order to turn on this case of "special support". In another cases - of course all will behaviors like it does right now.
Of course the average user should not be asked to design their own browser installation.
But those who have it - and with the technical ability to support this way of using libraries - it's worth taking advantage of it.
#146217 personal license
User avatar
AntonyD
Power Member
Power Member
Posts: 1231
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: Modern HTML viewer plugin

Post by *AntonyD »

At least, in MS docs they are treated separately, so in your case you'll have to have DLLs from a package "Microsoft WebView2 FixedVersionRuntime", not "MS Edge".
Do you know from where their run-time setups could be downloaded?
Or even so - you know - which libraries (DLL names?) are responsible for this class?
It can't be that these are some purely system libraries that are delivered to my computer directly from the depths of Microsoft.
#146217 personal license
User avatar
AntonyD
Power Member
Power Member
Posts: 1231
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: Modern HTML viewer plugin

Post by *AntonyD »

https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#details-about-the-fixed-version-runtime-distribution-mode
At least I already found that:
Environment.SetEnvironmentVariable("WEBVIEW2_BROWSER_EXECUTABLE_FOLDER", fixedPath);
where fixedPath - is path to unpacked folder with Fixed Version distribution.
And it can be left to the user to decide whether or not to take up disk space for unpacking these libraries.
Last edited by AntonyD on 2022-11-28, 07:36 UTC, edited 1 time in total.
#146217 personal license
User avatar
rg_software
Member
Member
Posts: 113
Joined: 2009-08-06, 12:59 UTC
Location: Aizu-Wakamatsu, Japan

Re: Modern HTML viewer plugin

Post by *rg_software »

Well, I will add SetEnvironmentVariable() next time, and we'll see whether it helps or not.
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Modern HTML viewer plugin

Post by *petermad »

2rg_software

I suggest that you add PDF to the extensions section of edgeviewer.ini by default.

Would it be possible to add support for the Edge switches: --ie-mode-file-url --internet-explorer-integration=iemode
It is practical for running in IE mode with support for ActiveX - but maybe it is only msedge.exe itself that supports those parameters, and not msedgewebview2.exe ?
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
rg_software
Member
Member
Posts: 113
Joined: 2009-08-06, 12:59 UTC
Location: Aizu-Wakamatsu, Japan

Re: Modern HTML viewer plugin

Post by *rg_software »

Hi all,
Try this update.

What's new:
* a new Javascript-based markdown viewer (no idea whether it is better, but makes my code simpler).
* a possibility to remove UserDir setting to use the plugin folder as a UserDir.
* a possibility to point the system to your own browser executable folder. No idea whether it works or not.
* a PDF support (I prefer sLister/Sumatra though).

Other notes:
* Sorry, no support for the Ctrl-less hotkeys like "4" yet. The browser hijacks user input, and it is a bit difficult to get it back.
* No idea whether the switches like --ie-mode-file-url --internet-explorer-integration=iemode work: I simply pass all the switches to Edge as is.
User avatar
AntonyD
Power Member
Power Member
Posts: 1231
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: Modern HTML viewer plugin

Post by *AntonyD »

* a possibility to point the system to your own browser executable folder. No idea whether it works or not.
; use BrowserExecutableFolder to point to your fixed version Edge
; BrowserExecutableFolder=%USERPROFILE%\Edge
But definitely for different bitness of plugin(fixed version Edge) we must use different env.var.!
This 64 bit plug will use BrowserExecutableX64Folder, and 32 bit plug - BrowserExecutableX86Folder
And yes - it works, but unfortunately because of the very essence of the Edge engine/Fixed-ver.runtime we get significant "brakes".
Where a similar MarkdownView plugin opens a file and shows it in a second - this plugin loses up to 5/7 secs
before showing exactly the same picture... Well, except that the colors are a little different.
Of course, this does not mean that the plugin is useless. But still, using this "Edge-like" engine turned out to be not a very interesting option.
I thought that "they" were able to write high-speed engine code here. Especially taking into account the huge weight of both: the browser itself and the Fixed-ver.runtime ... A bunch of bytes are occupied on the disk, and there is zero sense from them...
#146217 personal license
User avatar
AntonyD
Power Member
Power Member
Posts: 1231
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: Modern HTML viewer plugin

Post by *AntonyD »

2rg_software
One guaranteed minus, which was revealed due to the lack of support for the DETECT-string.
Total in the latest release began to divide the set of plugins into the most suitable, more or less suitable
and everyone else. And determining which group a particular plugin will be in depends on the DETECT string.
in particular. AFAIK. On the latest version of the plugin, it is now at the very tail end of "everyone else".
Because there is no suitable line of supported extensions for it.
I HIGHLY RECOMMEND bringing this support back)))
#146217 personal license
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Modern HTML viewer plugin

Post by *petermad »

I also recommend to bring back support for the detect string in wincmd.ini
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
rg_software
Member
Member
Posts: 113
Joined: 2009-08-06, 12:59 UTC
Location: Aizu-Wakamatsu, Japan

Re: Modern HTML viewer plugin

Post by *rg_software »

Yet another update!

* Different paths for the standalone 32 and 64 bit Edge.
* Detect string is back. Note that changing extensions in the INI won't affect the detect string, so you'll need to reinstall the plugin to apply changes or edit the string manually.
* Finally, hotkeys 1-8 are supported.
But still, using this "Edge-like" engine turned out to be not a very interesting option.
I thought that "they" were able to write high-speed engine code here
I started this to bring modern HTML compliance (the old WebView won't render everything) and AsciiDoc support. There are other relevant file types it can open like PDF, so it can be attractive as a universal tool, but speed is not its forte.

Note that it is quite fast when you switch between consecutive documents in the "quick preview" mode. In theory it should be possible to preload the plugin when TC starts and reuse hidden windows.
User avatar
AntonyD
Power Member
Power Member
Posts: 1231
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: Modern HTML viewer plugin

Post by *AntonyD »

; BrowserExecutableX86Folder=%USERPROFILE%\Edge32
; BrowserExecutableX86Folder=%USERPROFILE%\Edge64

typo? X86 in both cases?

Default DETECT string is: EXT=""|EXT=""|EXT=""????
Where are all extensions? Folder-case - can be definitely reparsed separately inside the plugins logic
but all real extensions should be presented in the DETECT string as is)))

According to INI file it should be equal to:
EXT="HTM"|EXT="HTML"|EXT="XML"|EXT="PDF"|EXT="MD"|EXT="MARKDOWN"|EXT="ADOC"|EXT="ASCIIDOC"

BTW - what are these ADOC && ASCIIDOC extensions??? Do we really have such files on our computers?

BTW - shortcuts 1-8 keys - do not work yet((( do not fully work... From MD files - yes, I can use them.
From PDF - nope...
#146217 personal license
Post Reply