সহায়তা খুঁজুন

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

আরও জানুন

.config file

  • 4 উত্তরসমূহ
  • 1 এই সমস্যাটি আছে
  • 1 দেখুন
  • শেষ জবাব দ্বারা 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();

t.santos-ext দ্বারা পরিমিত

All Replies (4)

more options

.....

t.santos-ext দ্বারা পরিমিত

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.