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!

Prohledat stránky podpory

Vyhněte se podvodům. Za účelem poskytnutí podpory vás nikdy nežádáme, abyste zavolali nebo poslali SMS na nějaké telefonní číslo nebo abyste sdělili své osobní údaje. Jakékoliv podezřelé chování nám prosím nahlaste pomocí odkazu „Nahlásit zneužití“.

Zjistit více

.config file

  • 4 odpovědi
  • 1 má tento problém
  • 1 zobrazení
  • Poslední odpověď 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();

Upravil uživatel t.santos-ext dne

Všechny odpovědi (4)

more options

.....

Upravil uživatel t.santos-ext dne

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.