Przeszukaj pomoc

Unikaj oszustw związanych z pomocą.Nigdy nie będziemy prosić Cię o dzwonienie na numer telefonu, wysyłanie SMS-ów ani o udostępnianie danych osobowych. Zgłoś podejrzaną aktywność, korzystając z opcji „Zgłoś nadużycie”.

Learn More

block file:///c:/ in Firefox

  • 3 odpowiedzi
  • 1 osoba ma ten problem
  • 195 wyświetleń
  • Ostatnia odpowiedź od Amelia

more options

Is there any way to block file:///c:/ in Firefox via firefox.cfg, userchrome or usercontent.css configuration file, it would be very useful. Thanks in advance Regards

Is there any way to block file:///c:/ in Firefox via firefox.cfg, userchrome or usercontent.css configuration file, it would be very useful. Thanks in advance Regards

Wybrane rozwiązanie

You can do it with the WebsiteFilter in Windows Group Policy or a policies.json file. Here are the match patterns as you would express them in a policies.json file (for Firefox 83 and later):

{
  "policies": {
      "WebsiteFilter": {
          "Block": [
            "file:///C:/*",
            "view-source:file:///C:/*"
          ]
      }
  }
}


References:

Przeczytaj tę odpowiedź w całym kontekście 👍 1

Wszystkie odpowiedzi (3)

more options

Wybrane rozwiązanie

You can do it with the WebsiteFilter in Windows Group Policy or a policies.json file. Here are the match patterns as you would express them in a policies.json file (for Firefox 83 and later):

{
  "policies": {
      "WebsiteFilter": {
          "Block": [
            "file:///C:/*",
            "view-source:file:///C:/*"
          ]
      }
  }
}


References:

more options

It works perfectly. What is the difference between what is applied in policies.json and what is applied in firefox.cfg or in usercontent.css or userchrome.css? Thanks

more options

Hello,

Policies.json is a file that contains the policies that an administrator has set. Note that on windows, you may also be able to use the group policy editor for the same purpose.

Firefox.cfg is used for mass configuration on networks, see more here Customizing Firefox Using AutoConfig

usercontent.css is a file that can not do either of these things, and is instead a file that is loaded into websites in order to change their appearance. In this file, you can specify a website and use css to persistently change elements in css. As an example, I am right now using support.mozilla.org in a dark mode, something not possible normally, as Firefox disables extensions from accessing support.mozilla.org.

userchrome.css is a similar file to usercontent, but instead of changing the websites, it changes the user interface of Firefox (named chrome). As an example, I am using the tweak Lepton (aka proton-fix) in photon look because I dislike the new look. Because of the userchrome.css file, I can have the browser look like whatever I want.