Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Funkcjonalność tej witryny będzie ograniczona w czasie konserwacji. Jeśli artykuł nie rozwiązuje twojego problemu i chcesz zadać pytanie, to nasza społeczność wsparcia jest dostępna na @FirefoxSupport na Twitterze i /r/firefox na Reddicie.

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”.

Więcej informacji

.config file

  • 4 odpowiedzi
  • 1 osoba ma ten problem
  • 1 wyświetlenie
  • Ostatnia odpowiedź od Mike Kaply

more options

Hello,

I am currently having an issue with Firefox 78.8 not reading .conf file.

i detected that the options bellow are not working now. We had it working with 52.9

Someting changed in the code? What am i missing?


//HM-Popup Exceptions Components.utils.import("resource://gre/modules/Services.jsm"); var uri = Services.io.newURI("http://site.example.net", null, null); Services.perms.add(uri, "popup", 1);


//userchrome and usercontent // const Cc = Components.classes; const Ci = Components.interfaces; Components.utils.import("resource://gre/modules/Services.jsm"); var profileDir = Services.dirsvc.get("ProfD", Ci.nsILocalFile); profileDir.append("chrome"); if( !profileDir.exists() || !profileDir.isDirectory() ) {

 profileDir.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0777);

} profileDir.append("userChrome.css"); var fos = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream); fos.init(profileDir, -1, -1, false); var css = "#nav-bar { display: none !important; } #toolbar-context-menu {display:none !important;} #TabsToolbar {display:none !important;}"; fos.write(css, css.length); fos.close();

Hello, I am currently having an issue with Firefox 78.8 not reading .conf file. i detected that the options bellow are not working now. We had it working with 52.9 Someting changed in the code? What am i missing? //HM-Popup Exceptions Components.utils.import("resource://gre/modules/Services.jsm"); var uri = Services.io.newURI("http://site.example.net", null, null); Services.perms.add(uri, "popup", 1); //userchrome and usercontent // const Cc = Components.classes; const Ci = Components.interfaces; Components.utils.import("resource://gre/modules/Services.jsm"); var profileDir = Services.dirsvc.get("ProfD", Ci.nsILocalFile); profileDir.append("chrome"); if( !profileDir.exists() || !profileDir.isDirectory() ) { profileDir.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0777); } profileDir.append("userChrome.css"); var fos = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream); fos.init(profileDir, -1, -1, false); var css = "#nav-bar { display: none !important; } #toolbar-context-menu {display:none !important;} #TabsToolbar {display:none !important;}"; fos.write(css, css.length); fos.close();

Zmodyfikowany przez t.santos-ext w dniu

Wszystkie odpowiedzi (4)

more options

.....

Zmodyfikowany przez t.santos-ext w dniu

more options

Check the Javascript console and see if there are any errors.

Changes in Firefox might have caused the script not to work anymore.

more options

If i insert the options above it will prompt:

Failed to read the configuration file. Please contact your system administrator.

For the popup exception i discovered that

This issue is that Services.perms.add no longer works.


Services.perms.addFromPrincipal(
      Services.scriptSecurityManager.createContentPrincipalFromOrigin("http://sriglx"),
      "popup", 1
    );

There's no need do a newURL anymore.

Am i correct?

Regarding the NAV BAR, Toolbar context menu, Tabs bar how can i hide it in the config file?

Can you help me please?

Thank you.

more options

I would recommend you use policies.json for blocking popups and not the autoconfig file.

https://github.com/mozilla/policy-templates/blob/master/README.md

Once you get that problem fixed, your other code for hiding the navbar and other things should still work.