Preview HTML files as text
Preview HTML files as text
The Preview pane (most recent version of 1.5(a)) renders an HTML file as a webpage (if the file has renderable elements; as opposed to just a script). I would like it to render it as plain text (i.e., show the tags, scripts, etc.).
I know I can edit the registry to do that, but I'd rather not do that if at all possible - I'd like File Explorer, for example, to continue to render these files as a web page.
My default text_plain_extensions entry in Everything-1.5a.ini already contains html.
Is that possible?
I know I can edit the registry to do that, but I'd rather not do that if at all possible - I'd like File Explorer, for example, to continue to render these files as a web page.
My default text_plain_extensions entry in Everything-1.5a.ini already contains html.
Is that possible?
Last edited by NotNull on Thu Jun 15, 2023 6:49 pm, edited 1 time in total.
Reason: Moved to Everything 1.5 forum
Reason: Moved to Everything 1.5 forum
Re: Preview HTML files as text
Everything uses the Windows 'engine' to preview files, so Explorer and Everything should show the same layout.
text_plain_extensions is for searching in the content of files; it is not used for previewing files.
However, there are ways ...
Those do involve changing the registry and those settings might be overwritten with the next Windows update.
Or the next Everything update.
Let me know if interested
text_plain_extensions is for searching in the content of files; it is not used for previewing files.
However, there are ways ...
Those do involve changing the registry and those settings might be overwritten with the next Windows update.
Or the next Everything update.
Let me know if interested
Re: Preview HTML files as text
Always interested in learning something new! Yes, please.Let me know if interested
Re: Preview HTML files as text
Everything doesn't have a good solution to do this at the moment.
I will explore ways to override the registry just for Everything, or add a custom ini setting to override the preview handler for certain extensions.
Like Windows Explorer, Everything will currently load preview handlers in the following order:
I will explore ways to override the registry just for Everything, or add a custom ini setting to override the preview handler for certain extensions.
Like Windows Explorer, Everything will currently load preview handlers in the following order:
- HKEY_CLASSES_ROOT\<class>\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
- HKEY_CLASSES_ROOT\<.extension>\<class>\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
- HKEY_CLASSES_ROOT\SystemFileAssociations\<.extension>\<class>\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}
Re: Preview HTML files as text
XYplorer has the concept of "User defined preview handlers".
This allows to override the system defaults by selecting the desired one with its Id.
The format looks like this:
This allows to override the system defaults by selecting the desired one with its Id.
The format looks like this:
Re: Preview HTML files as text
Assuming you are running Everything as regular user (no Administrator in the title bar).
If not: don't proceed and reply back. This requires a different soloution (which is available too).
If running as regular user:
- Start Command Prompt (CMD.exe)
- Execute the following 2 commands
Code: Select all
reg.exe add "HKCU\Software\Classes\.html\shellex\{8895B1C6-B41F-4C1C-A562-0D564250836F}" /ve /D "{f8b8412b-dea3-4130-b36c-5e8be73106ac}" /f reg.exe add "HKCU\Software\Classes\htmlfile\shellex\{8895B1C6-B41F-4C1C-A562-0D564250836F}" /ve /D "{1531d583-8375-4d3f-b5fb-d23bbd169f22}" /f
- Done!
To bring your system back to its original state, run tthe following 2 commands in Command Prompt:
Code: Select all
reg.exe delete "HKCU\Software\Classes\.html\shellex\{8895B1C6-B41F-4C1C-A562-0D564250836F}" /f
reg.exe delete "HKCU\Software\Classes\htmlfile\shellex\{8895B1C6-B41F-4C1C-A562-0D564250836F}" /f
(tested on Win11 22H2)
Re: Preview HTML files as text
Isn't that going to change the (OS) preview handler for html, to the windows text preview handler?
Re: Preview HTML files as text
What do you mean by "the (OS) preview handler for html"?
A preview handler can be configured on multiple levels (at least 6).
Explorer will still show .html files as html formatted, not as plain (raw) text.
Re: Preview HTML files as text
For me the OS html preview handler is
Preview Handler information:
GUID : {f8b8412b-dea3-4130-b36c-5e8be73106ac}
Description : CLSID_PreviewHtml
Module name : C:\Windows\System32\inetcomm.dll
Localserver :
Note: Preview Handler is registered on the ProgID (htmlfile)
In my preferred tool to change it, its the 2nd of the handlers named
Microsoft Windows Mail Mime Preview Handler ______________________________________________________
Windows 11 Home x64 Version 22H2 (OS Build 22621.1848)
Everything 1.5.0.1350a (x64), Everything Toolbar 1.1.1
Preview Handler information:
GUID : {f8b8412b-dea3-4130-b36c-5e8be73106ac}
Description : CLSID_PreviewHtml
Module name : C:\Windows\System32\inetcomm.dll
Localserver :
Note: Preview Handler is registered on the ProgID (htmlfile)
In my preferred tool to change it, its the 2nd of the handlers named
Microsoft Windows Mail Mime Preview Handler ______________________________________________________
Windows 11 Home x64 Version 22H2 (OS Build 22621.1848)
Everything 1.5.0.1350a (x64), Everything Toolbar 1.1.1
Re: Preview HTML files as text
Same here. That is the out-of-the-box html previewer (and also the one I used in the command above).
Thanks for the info!
(I changed my previous message/question to make the intent more clear)
Re: Preview HTML files as text
On possible way may be using the Delphi preview handler
and assign the type htmlfile to it.
and assign the type htmlfile to it.
Re: Preview HTML files as text
Everything 1.5.0.1351a adds a preview_handlers ini setting.
To preview html/htm files as text/plain:
A Custom Preview Handler UI is on my TODO list.
To preview html/htm files as text/plain:
- In Everything 1.5, from the Tools menu, click Options.
- Click the Advanced tab on the left.
- To the right of Show settings containing, search for:
preview - Select preview_handlers.
- Set the value to:
Code: Select all
[{"filter":"*.html;*.htm","handler":"{1531d583-8375-4d3f-b5fb-d23bbd169f22}"}]
- Click OK.
A Custom Preview Handler UI is on my TODO list.
Re: Preview HTML files as text
In my Everything (version 1.5.0.1347a (x64)) there is no preview_handlers entry in Advanced:
- Attachments
-
- preview_handlers.png (19.89 KiB) Viewed 14593 times
Re: Preview HTML files as text
It's not in 1347a.In my Everything (version 1.5.0.1347a (x64))
Download 1351a & it will be there.
(When I looked in my end, it wasn't in my 1349a either .
So I put in 1351a, & sure enough...)
Re: Preview HTML files as text
I'll do that, of course. But I have to point out that before I ask any question, I do check with Help/Check for Updates. The response I get is "Everything is up to date!"...It's not in 1347a.
Download 1351a & it will be there.
Re: Preview HTML files as text
It is an alpha version .. Just check the forum to see if there are any updates.
This link points to the latest version.
This link points to the latest version.
Re: Preview HTML files as text
Understood, just didn't think about this particular point in that context. Maybe until it comes out of alpha, the message there should indeed be to check the forum.
-
- Posts: 473
- Joined: Thu Dec 15, 2016 9:44 pm
Re: Preview HTML files as text
I got informed by Everything of the latest alpha release just now. This may be relatively new.
-
- Posts: 23
- Joined: Tue Mar 20, 2018 9:04 pm
Re: Preview HTML files as text
Hello,
I updated to 1352a and I have a problem with the preview behavior.
I have lot of text files types (some non standard) that I ask windows to perceive as text. e.g. in the registry:
[HKEY_CLASSES_ROOT\.cps]
"PerceivedType"="text
[HKEY_CLASSES_ROOT\.py]
"PerceivedType"="text
[HKEY_CLASSES_ROOT\.txt]
"PerceivedType"="text
I can then see a quick preview in explorer and everything. I use it all the time to locate scripts, etc.
After updating to 1352a: this preview does not work anymore (even .txt).
I can preview pdf, etc. but not these text files
I downgraded to 1349a and it is the same.
Any idea on how to get it to work again?
Thanks
Philippe
I updated to 1352a and I have a problem with the preview behavior.
I have lot of text files types (some non standard) that I ask windows to perceive as text. e.g. in the registry:
[HKEY_CLASSES_ROOT\.cps]
"PerceivedType"="text
[HKEY_CLASSES_ROOT\.py]
"PerceivedType"="text
[HKEY_CLASSES_ROOT\.txt]
"PerceivedType"="text
I can then see a quick preview in explorer and everything. I use it all the time to locate scripts, etc.
After updating to 1352a: this preview does not work anymore (even .txt).
I can preview pdf, etc. but not these text files
I downgraded to 1349a and it is the same.
Any idea on how to get it to work again?
Thanks
Philippe
Re: Preview HTML files as text
Without further details: Sounds like you installed and uninstalled Microsoft PowerToys in between? The Monaco code preview handler that comes with it is a mess (to put it politely). But there are solutions for that (I had to write a script as all code extensions were broken by PowerToys ..
For better assistance, more information is needed:
After uprading to Everything 1352a, did the preview fail in Everything or in Explorer too?
And after downgrading to 1349a, "it is the same". Same behaviour as 1352a or same behaviour as the original pre-1352a setup?
-
- Posts: 23
- Joined: Tue Mar 20, 2018 9:04 pm
Re: Preview HTML files as text
Thank you for your response (and sorry for the missing details).
* It always kept working in explorer
* I have powertoys with monaco disabled (a long time ago). It crashed all the time so I don't use it. I don't think it was ever enabled on the PC where the problem occured.
* downgrading: it did not work anymore in 1349a after downgrading (=no preview for extensions for which I used the PerceivedType=text in the registry). But I rebooted and now it works again.
As a summary: So it seems like Everything did not consider the PerceivedType=text settings?? (I have many of those).
[HKEY_CLASSES_ROOT\.xydata]
"PerceivedType"="text"
I can try to update again if there is something to try.
Thanks
Philippe
* It always kept working in explorer
* I have powertoys with monaco disabled (a long time ago). It crashed all the time so I don't use it. I don't think it was ever enabled on the PC where the problem occured.
* downgrading: it did not work anymore in 1349a after downgrading (=no preview for extensions for which I used the PerceivedType=text in the registry). But I rebooted and now it works again.
As a summary: So it seems like Everything did not consider the PerceivedType=text settings?? (I have many of those).
[HKEY_CLASSES_ROOT\.xydata]
"PerceivedType"="text"
I can try to update again if there is something to try.
Thanks
Philippe
Re: Preview HTML files as text
It does, but there are several places in the registry where a preview handler can be configured.phil2search wrote: ↑Wed Jul 12, 2023 10:32 am As a summary: So it seems like Everything did not consider the PerceivedType=text settings?? (I have many of those).
You can run [ur=viewtopic.php?p=56809#p56809l]this script[/url] and post the output of a .py and a .xydata file here (see instructions in that post).
That should give a decent clue of what is going on.
-
- Posts: 23
- Joined: Tue Mar 20, 2018 9:04 pm
Re: Preview HTML files as text
Thanks for your response.
I started looking at the page and then tried 1352a portable on my second machine (similar configuration). And it worked.
Installed it. And it worked.
Went back to the one with the issue and reinstalled 1352a. And it is worked...
Strange.
So it seems it just needed to reboot.
Problem solved.
Sorry for the disturbance.
Philippe
I started looking at the page and then tried 1352a portable on my second machine (similar configuration). And it worked.
Installed it. And it worked.
Went back to the one with the issue and reinstalled 1352a. And it is worked...
Strange.
So it seems it just needed to reboot.
Problem solved.
Sorry for the disturbance.
Philippe
Re: Preview HTML files as text
Just making a note here...
Everything 1.5.0.1356a will now support full filename filters in preview_handlers.
This includes regex support with the regex: prefix and full path matching.
For example:
"filter":"regex:^foo"
"filter":"regex:\\.(jpg|jpeg)$"
"filter":"c:\\only-this-folder\\**.jpg"
The first (or left-most) filter that matches is used.
Everything 1.5.0.1356a will now support full filename filters in preview_handlers.
This includes regex support with the regex: prefix and full path matching.
For example:
"filter":"regex:^foo"
"filter":"regex:\\.(jpg|jpeg)$"
"filter":"c:\\only-this-folder\\**.jpg"
The first (or left-most) filter that matches is used.