windows firefox 用资源管理器打开本地链接到目录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1804604/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 06:57:13  来源:igfitidea点击:

firefox open local link to directory with explorer

firefoxwindows

提问by raffael

On a Website for our internal use i show links to local files and folders. the links are like this:

在供我们内部使用的网站上,我会显示指向本地文件和文件夹的链接。链接是这样的:

href="file://C:/example/"
href="file://C:/example/test.odt"

The Problem is now that the link to the directory does open in firefox itself with a useless directory listing. Useless because you can just see the files or open them but not copy, insert, delete... The link to the file work normal and the file is opend by OpenOffice. By changing the configuration of firefox and setting the following key to false I can open the directory in with explorer.exe but for the file I have to choose the right application.

现在的问题是,指向该目录的链接确实在 Firefox 中打开,并带有一个无用的目录列表。没用,因为你只能看到文件或打开它们,但不能复制、插入、删除...文件的链接工作正常,文件被 OpenOffice 打开。通过更改 firefox 的配置并将以下键设置为 false,我可以使用 explorer.exe 打开目录,但对于该文件,我必须选择正确的应用程序。

network.protocol-handler.expose.file

Does someone know a way to get both to work like i want? Means that the Directory is shown by explorer.exe and all files are opened by the right application. This can be by configuring Firefox or windows, changing the links, or even by writing a small program which opens all the file protocol correctly and will be used as protocol handler for the file protocol in firefox.

有人知道让两者都像我想要的那样工作的方法吗?表示目录由 explorer.exe 显示,并且所有文件都由正确的应用程序打开。这可以通过配置 Firefox 或 windows,更改链接,甚至编写一个小程序来正确打开所有文件协议,并将用作 Firefox 中文件协议的协议处理程序。

Thanks Raffael

谢谢拉斐尔

回答by RangerJo

I did the above with small changes in Firefox 14.0.1, which works for me:

我在 Firefox 14.0.1 中做了一些小的改动,这对我有用:

  1. Create new boolean value network.protocol-handler.expose.fileand set it to false
  2. Create new boolean value network.protocol-handler.external.fileand set it to true
  3. Click on a link to a local folder.
  4. In the following prompt, link to the explorer.exe in: C:\Windows\explorer.exe
  1. 创建新的布尔值network.protocol-handler.expose.file并将其设置为 false
  2. 创建新的布尔值network.protocol-handler.external.file并将其设置为 true
  3. 单击指向本地文件夹的链接。
  4. 在以下提示中,链接到 explorer.exe 中: C:\Windows\explorer.exe

Files are now open with the default application, folders are open with the Windows Explorer!

现在使用默认应用程序打开文件,使用 Windows 资源管理器打开文件夹!

回答by Dan

I know this is not quite what you want, but you might take a look at the "launchy" addon for firefox:

我知道这不是你想要的,但你可以看看 firefox 的“launchy”插件:

https://addons.mozilla.org/en-US/firefox/addon/81/

https://addons.mozilla.org/en-US/firefox/addon/81/

Using this addon you can right click on a file link, go to "launchy" sub-menu, and tell it to open in explorer. This will browse directly to the folder as you want.

使用此插件,您可以右键单击文件链接,转到“launchy”子菜单,并告诉它在资源管理器中打开。这将根据需要直接浏览到文件夹。

I want the same feature you want, however this "works" for now. I have asked the author of launchy to allow it to override the left-click behavior for certain protocols (so it would launch explorer with one click), but I don't have a response yet.

我想要你想要的相同功能,但是现在这个“有效”。我已经要求 launchy 的作者允许它覆盖某些协议的左键单击行为(因此它可以一键启动资源管理器),但我还没有回应。

edit: Years later, I will post the solution I started using instead of Launchy:

编辑:多年后,我将发布我开始使用的解决方案而不是 Launchy:

https://addons.mozilla.org/en-us/firefox/addon/local-filesystem-links/

https://addons.mozilla.org/en-us/firefox/addon/local-filesystem-links/

https://github.com/feinstaub/firefox_addon_local_filesystem_links

https://github.com/feinstaub/firefox_addon_local_filesystem_links

This scans for file:// links and makes them clickable. It does inject some HTML which can mess with formatting if you aren't careful, but it does the job.

这会扫描 file:// 链接并使它们可点击。它确实注入了一些 HTML,如果您不小心,这些 HTML 可能会弄乱格式,但它可以完成工作。

回答by Bj?rn Tantau

In about:configYou need to add a boolean value with the name network.protocol-handler.expose.fileand set it to falseand also create a string value with the name capability.policy.default.checkloaduri.enabledand set it to allAccess.

about:config您需要添加一个带有名称的布尔值并将其network.protocol-handler.expose.file设置为,false并创建一个带有名称的字符串值并将其capability.policy.default.checkloaduri.enabled设置为allAccess.

Now you will be able to choose C:\Windows\explorer.exeto open file links.

现在您将能够选择C:\Windows\explorer.exe打开文件链接。

Tested in FF 19.0.2 in Windows 7.

在 Windows 7 中的 FF 19.0.2 中测试。

回答by Roland

Or You can use the Plugin "Local Filesystem Links" now.

或者您现在可以使用插件“本地文件系统链接”。

回答by Mikel

Try this: Create new boolean value with the name network.protocol-handler.expose.fileand set it to false

试试这个:使用名称创建新的布尔值并将其 network.protocol-handler.expose.file设置为 false

Create new boolean value with the name network.protocol-handler.external.fileand set it to true

使用名称创建新的布尔值并将其 network.protocol-handler.external.file设置为 true

Open link to a local directory and on the now appearing box, register the "file"-protocol permanently with the "file"-programm (1st entry). There should now open the windows explorer. You can deassociate the type "file"in the Firefox-settings (applications-tab).

打开指向本地目录的链接,然后在现在出现的框中,使用"file"-programm "file"(第一个条目)永久注册-protocol 。现在应该打开 Windows 资源管理器。您可以"file"在 Firefox 设置(应用程序选项卡)中取消关联类型。

After that, a link to a document (i.e. file:///x:\dir\file.doc) worked automatically for me (FF8.0).

之后,指向文档的链接(即file:///x:\dir\file.doc)自动对我来说有效(FF8.0)。