Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't open some html files in chrome (mac)

There are some HTML files (no pattern that I've figured out) that I can't open via the terminal, GUI or right clicking Open in Browser via Sublime Text 3.

The default browser to open the file is definitely set to Chrome. When I say to open the file in the browser it takes me to the Chrome window, but doesn't actually open the file I want.

I can open these files in Chrome itself via command + O and in Firefox or Safari by right clicking on the file and selecting them in the GUI.

It'd be great if Chrome would open files when I expect it to. I'd appreciate any help.

like image 511
Gwater17 Avatar asked Sep 14 '16 04:09

Gwater17


People also ask

How do I open an HTML File in Chrome on a Mac?

Assuming Google Chrome is set as your default program, you should simply double tap the HTML document and it will naturally open in Chrome.

Why is HTML File not opening in Chrome?

Reload this web page later. Try adding Google Chrome as a permitted program in your firewall or antivirus software's settings. If it is already a permitted program, try deleting it from the list of permitted programs and adding it again.

How do I open a HTML File in my browser Mac?

View an HTML document In the TextEdit app on your Mac, choose File > Open, then select the document. Click Options at the bottom of the TextEdit dialogue, then select “Ignore rich text commands”. Click Open.

Why HTML File is not opening in browser?

Check if the file is saved with a UTF-8 encoding. If that doesn't work, try installing another browser or using Edge/Safari/Internet Explorer or whatever built-in browser you have. It is saved as index. html.


1 Answers

I had the same problem. Fixed it by running this in the terminal after closing Chrome:

open /Applications/Google\ Chrome.app --args --allow-file-access-from-files

The command line args can be viewed in Chrome by visiting chrome://version/

Chrome didn't load local files for me before running this command, but for some reason Chrome Canary did.

like image 132
sgr12 Avatar answered Sep 19 '22 12:09

sgr12