Alex
Alex

Reputation: 44265

How to allow google-chrome to open a local html file?

Using google-chrome Version 81.0.4044.138 (Official Build) (64-bit) on a MacbookAir Mojave I want to open a html file that is located on the filesystem and linked from another page i.e woth something like

<a href="file:///folder/something/summary.html">bla</a>

but when clicking on that link I only see the following text in the address bar

 about:blank#blocked

Is there any way to enable this/ allow this, so that I can open that page with one click?

So far I have to:

to open the page. Can this be made ANY way simpler?

P.S. These local html files are generated by myself and do link themselves only to pages that are trusted. I do not see any security risks.

Upvotes: 0

Views: 17845

Answers (3)

Craig
Craig

Reputation: 21

The security risk is anyone can create a webpage with a link to local files on your hard drive. Say an executable. Disguise the link text and what displays in the status to hide what it points to.

Upvotes: 0

Puneet Chandhok
Puneet Chandhok

Reputation: 422

We do not use file protocol to open other html, css, js or image files.

"file://" requires absolute path and instruct browsers to download a file. many browsers will block the file.

just use <link href="/folder/something/summary.html">Summary</a>. Use relative path from index.html file location.

Upvotes: 2

tukan
tukan

Reputation: 17337

This has been disabled on purpose - security. You can directly open file via file:/// directive, but not via links.

The only way I found out is to install a plugin called Enable local file links. If you want to check source code to be sure you can do that at its github page.

It will enable you opening a local file when clicking on a shortcut.

Upvotes: 2

Related Questions