从Firefox或Chrome启动文件://

Jun*_*lip 10 firefox compatibility google-chrome cross-browser hyperlink

我正在寻找一种方法来启动位于我们本地文件网络上的文件,以便通过我们的本地Intranet使用Firefox或Chrome进行使用.

该链接在IE中运行良好:

<a href="\\Start\Of\My\Network\file.xlsx">View Report</a>&nbsp;
Run Code Online (Sandbox Code Playgroud)

但在Firefox中显示:

<a href="http://mydomain.com/\\Start\Of\My\Network\file.xlsx">View Report</a>&nbsp;
Run Code Online (Sandbox Code Playgroud)

有没有办法让链接正确呈现?...只需从href标签中单击即可.

api*_*guy 1

出于安全原因,Firefox 中未启用此功能(请记住,大多数计算机的敏感文件和应用程序位于类似位置,例如 C:\System\Windows)

您可以尝试将其添加到 user.js 文件中,以便任何需要能够访问这些链接的用户:

user_pref("capability.policy.policynames", "localfilelinks");
user_pref("capability.policy.localfilelinks.sites", "file:///[[PUT SERVER NAME HERE]]";);
user_pref("capability.policy.localfilelinks.checkloaduri.enabled",  "allAccess");
Run Code Online (Sandbox Code Playgroud)

请记住,这是一个安全风险。