Trang web này sẽ có chức năng hạn chế trong khi chúng tôi trải qua bảo trì để cải thiện trải nghiệm của bạn. Nếu một bài viết không giải quyết được vấn đề của bạn và bạn muốn đặt câu hỏi, chúng tôi có cộng đồng hỗ trợ của chúng tôi đang chờ để giúp bạn tại @FirefoxSupport trên Twitter và /r/firefox trên Reddit.

Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Tìm hiểu thêm

work offline mode and localhost server

  • 2 trả lời
  • 1 gặp vấn đề này
  • 1 lượt xem
  • Trả lời mới nhất được viết bởi cor-el

more options

What is the expected behavior of the "Work Offline" mode regarding the access to a local server? To test my new Progressive Web App and its Service-Worker, I'd like to switch off temporary firefox from the network access. For this purpose, I though to use File->"Work Offline". What I observe is that in "Work Offline" mode the access to internet is disable (as I expect) but the access to my local web server for development is still avalaible (and I'm surprise about this behavior). To make sure that the Browser cache is not responsible for this behavior, I have clear the cache and disable the cache. Still I get the unexpected behavior: In "Work Offline" mode, Firefox can still request and download data from a localhost server! If I stop my localhost server, then Firefox complains about the missing data. Which is what I expect and what I also would like to see in "Work Offline" mode. What is the expected behavior of the "Work Offline" mode for the local servers? Is the current behavior a bug? I have also tried Chromium and it behaves as I expect, i.e. in "Work Offline" mode access to internet AND local servers are prevented. I'm running Ubuntu 18.04 and Firefox 67.0.3 (64-bit)

What is the expected behavior of the "Work Offline" mode regarding the access to a local server? To test my new Progressive Web App and its Service-Worker, I'd like to switch off temporary firefox from the network access. For this purpose, I though to use File->"Work Offline". What I observe is that in "Work Offline" mode the access to internet is disable (as I expect) but the access to my local web server for development is still avalaible (and I'm surprise about this behavior). To make sure that the Browser cache is not responsible for this behavior, I have clear the cache and disable the cache. Still I get the unexpected behavior: In "Work Offline" mode, Firefox can still request and download data from a localhost server! If I stop my localhost server, then Firefox complains about the missing data. Which is what I expect and what I also would like to see in "Work Offline" mode. What is the expected behavior of the "Work Offline" mode for the local servers? Is the current behavior a bug? I have also tried Chromium and it behaves as I expect, i.e. in "Work Offline" mode access to internet AND local servers are prevented. I'm running Ubuntu 18.04 and Firefox 67.0.3 (64-bit)

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

The work offline mode only blocks remote resources. Local files or local servers will still be available if they are running on your machine.

For example, if you have Work Offline mode enabled, you can't go to the Mozilla website or even access your router via it's IP address, but you can access locally installed development environment that uses localhost or 127.0.0.1 or something along those lines because those are considered "offline resources" as opposed to "remote resources".

What you are experiencing is not a bug.

Hope this answers your question.

Đọc câu trả lời này trong ngữ cảnh 👍 1

Tất cả các câu trả lời (2)

more options

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

The work offline mode only blocks remote resources. Local files or local servers will still be available if they are running on your machine.

For example, if you have Work Offline mode enabled, you can't go to the Mozilla website or even access your router via it's IP address, but you can access locally installed development environment that uses localhost or 127.0.0.1 or something along those lines because those are considered "offline resources" as opposed to "remote resources".

What you are experiencing is not a bug.

Hope this answers your question.

more options

See also this pref on the about:config page.

  • network.dns.offline-localhost

You can open the about:config page via the location/address bar. You can accept the warning and click "I accept the risk!" to continue.