问题
In a Markdown Page (Microsoft TFS Wiki)
I try crate A tag for file
link:
<a href="file:///C:/temp\file.txt">file.txt</a>
On click (Chrome), I got
about:blank#blocked
回答1:
It's not a Chrome-specific issue with protocol file:, Opera and Firefox display blank page too.
When I want to browse HTML files on my localhost, I have to access them via protocol http: instead.
For instance when I want to see C:\temp\file.html
in Chrome, I will make a virtual directory in my local Apache host:
<VirtualHost *:80>
DocumentRoot C:/temp
ServerName temp.localhost
</VirtualHost>
and add this line to %SystemRoot%\System32\drivers\etc\hosts
127.0.0.1 temp.localhost
Now I can see the file in browsers at URL http://temp.localhost/file.html
来源:https://stackoverflow.com/questions/55101162/aboutblankblocked-on-a-href-file-xxxlink-a-markdown-page