1

I have an HTML file on my local machine:

echo '<h1>Hello Chromium</h1>' > test

If I open it using chromium test, it does not render the page, but shows the source code. The same file being named test.html and opened with chromium test.html, opens in chromium and is rendered.

How can I force Chromium to render local files without an HTML extension in their filename?

NB: the context is that I'd like to open HTML documents from mutt, which are stored in /tmp without the .html extension.

nyi
  • 113
  • HTML cannot be identified by looking at magic numbers or anything the like. How would Chrome be able to reliably guess the file type? – Daniel B Sep 02 '18 at 09:45
  • @DanielB I'm not saying that Chrome is doing something wrong. But how can I force it to do what I want? Maybe there is an option -mimetype text/html or something similar I couldn't find while googling. – nyi Sep 02 '18 at 12:42
  • @DanielB A lot of HTML files have a variant of as the first line. Firefox accepts this, but Chrome/Chromium does not, for some reason. – Heptite Sep 15 '18 at 00:46

1 Answers1

0

If you are using Windows, the simplest solution would be to start the Command Prompt (cmd), navigate to the folder, and enter the command :

ren * *.html

This would have the advantage of not changing the setup of Chrome.
You would need to download the files into an empty folder.

harrymc
  • 480,290