X
Nhấn vào đây để đến phiên bản di động của trang web.

Diễn đàn trợ giúp

How to access the local filesystem from a webpage in Firefox

Được đăng

We are wanting to move our intranet users from IE to Firefox but we have some places where we want to be able to open local (or network) files or directories. I have found quite a few references in Stack Overflow and otherwise but most of them are quite old and none of the old techniques seem to work with the current version of Firefox Quantum (v68 at the time of writing).

The Local Filesystem Links extension seems to work well but I would rather not rely on an extension, particularly one that also requires installation of an addon module, if possible. Can anybody tell me how to access the local filesystem from a webpage in Firefox by just changing settings in about: config? Or is this just not possible anymore?

I am hoping to get something like <a href="file://///networkdrive/directory"> working if possible

We are wanting to move our intranet users from IE to Firefox but we have some places where we want to be able to open local (or network) files or directories. I have found quite a few references in Stack Overflow and otherwise but most of them are quite old and none of the old techniques seem to work with the current version of Firefox Quantum (v68 at the time of writing). The Local Filesystem Links extension seems to work well but I would rather not rely on an extension, particularly one that also requires installation of an addon module, if possible. Can anybody tell me how to access the local filesystem from a webpage in Firefox by just changing settings in about: config? Or is this just not possible anymore? I am hoping to get something like <a href="file://///networkdrive/directory"> working if possible

Giải pháp được chọn

Your timing is excellent, there is now a Policy/GPO way to do this as of Firefox 68. No extension required. See:


There also is an old school method which is backwards compatible and doesn't require an extension. It involves adding some lines to an optional user.js file (in the user's current Firefox profile), but which might be more conveniently deployed through an Autoconfig file (in the program folder). Those are both files Firefox reads at startup.

// == FILE URI LINK POLICY (checkloaduri) ==

// Create policy enabling http: or https: pages to link to file:
user_pref("capability.policy.policynames", "filelinks");
user_pref("capability.policy.filelinks.checkloaduri.enabled", "allAccess");

// Sites to which the policy applies (protocol://hostname protocol://hostname)
user_pref("capability.policy.filelinks.sites", "http://example.com http://intranet");
 

More info on Autoconfig: Customizing Firefox Using AutoConfig

Đọc câu trả lời này trong ngữ cảnh 1
Trích dẫn

Chi tiết hệ thống bổ sung

Ứng dụng

  • Chuỗi đại diện người dùng: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Firefox/68.0

Thông tin chi tiết

jscher2000
  • Top 10 Contributor
8583 giải pháp 70216 câu trả lời
Được đăng

Giải pháp được chọn

Your timing is excellent, there is now a Policy/GPO way to do this as of Firefox 68. No extension required. See:


There also is an old school method which is backwards compatible and doesn't require an extension. It involves adding some lines to an optional user.js file (in the user's current Firefox profile), but which might be more conveniently deployed through an Autoconfig file (in the program folder). Those are both files Firefox reads at startup.

// == FILE URI LINK POLICY (checkloaduri) ==

// Create policy enabling http: or https: pages to link to file:
user_pref("capability.policy.policynames", "filelinks");
user_pref("capability.policy.filelinks.checkloaduri.enabled", "allAccess");

// Sites to which the policy applies (protocol://hostname protocol://hostname)
user_pref("capability.policy.filelinks.sites", "http://example.com http://intranet");
 

More info on Autoconfig: Customizing Firefox Using AutoConfig

Your timing is excellent, there is now a Policy/GPO way to do this as of Firefox 68. No extension required. See: * LocalFileLinks policy configuration: https://github.com/mozilla/policy-templates#localfilelinks * [[Customizing Firefox Using Group Policy (Windows)]] * [[Customizing Firefox Using policies.json]] ---- There also is an old school method which is backwards compatible and doesn't require an extension. It involves adding some lines to an optional '''user.js''' file (in the user's current Firefox profile), but which might be more conveniently deployed through an Autoconfig file (in the program folder). Those are both files Firefox reads at startup. <pre>// == FILE URI LINK POLICY (checkloaduri) == // Create policy enabling http: or https: pages to link to file: user_pref("capability.policy.policynames", "filelinks"); user_pref("capability.policy.filelinks.checkloaduri.enabled", "allAccess"); // Sites to which the policy applies (protocol://hostname protocol://hostname) user_pref("capability.policy.filelinks.sites", "http://example.com http://intranet"); </pre> More info on Autoconfig: [[Customizing Firefox Using AutoConfig]]
Bài viết này có hữu ích với bạn không? 1
Trích dẫn

Người tạo câu hỏi

Thanks for that, I tried the old school method on my local machine and it worked perfectly, I will pass the policy method on to our IT team so they can apply it business-wide. I raised the same question on Stack Overflow, do you mind if I post your answer there?

Thanks for that, I tried the old school method on my local machine and it worked perfectly, I will pass the policy method on to our IT team so they can apply it business-wide. I raised the same question on Stack Overflow, do you mind if I post your answer there?
Bài viết này có hữu ích với bạn không?
Trích dẫn
jscher2000
  • Top 10 Contributor
8583 giải pháp 70216 câu trả lời
Được đăng

Hi mark_1, please feel free to share the info. And let us know how the new policy method works out.

Hi mark_1, please feel free to share the info. And let us know how the new policy method works out.
Bài viết này có hữu ích với bạn không?
Trích dẫn

Người tạo câu hỏi

Our IT team have added the policy and it is working for us but I had to do the following to get the directories to open in Windows Explorer rather than in a webpage within Firefox.

In about:config I added 2 preferences

network.protocol-handler.expose.file – set this to false network.protocol-handler.external.file – set this to true

Thanks very much for your help

Our IT team have added the policy and it is working for us but I had to do the following to get the directories to open in Windows Explorer rather than in a webpage within Firefox. In about:config I added 2 preferences network.protocol-handler.expose.file – set this to false network.protocol-handler.external.file – set this to true Thanks very much for your help
Bài viết này có hữu ích với bạn không?
Trích dẫn
Đặt một câu hỏi

Bạn phải đăng nhập vào tài khoản của bạn để trả lời bài viết. Vui lòng bắt đầu một câu hỏi mới, nếu bạn chưa có tài khoản.