Αυτός ο ιστότοπος θα έχει περιορισμένη λειτουργικότητα, όσο εκτελούμε εργασίες συντήρησης για να βελτιώσουμε την εμπειρία σας. Αν ένα άρθρο δεν επιλύει το ζήτημά σας και θέλετε να κάνετε μια ερώτηση, η κοινότητα υποστήριξής μας είναι έτοιμη να σας βοηθήσει στο Twitter (@FirefoxSupport) και στο Reddit (/r/firefox).

Αναζήτηση στην υποστήριξη

Προσοχή στις απάτες! Δεν θα σας ζητήσουμε ποτέ να καλέσετε ή να στείλετε μήνυμα σε κάποιον αριθμό τηλεφώνου ή να μοιραστείτε προσωπικά δεδομένα. Αναφέρετε τυχόν ύποπτη δραστηριότητα μέσω της επιλογής «Αναφορά κατάχρησης».

Μάθετε περισσότερα

How can I add popup-exceptions into mozilla.cfg?

  • 6 απαντήσεις
  • 2 έχουν αυτό το πρόβλημα
  • 59 προβολές
  • Τελευταία απάντηση από cleary

more options

Hi there

I have a mozilla.cfg file that configures some settings in Firefox. All the configurations are adapted except the popup configuration and the configurations bellow the popup-configuration.

After firefox is installed I check the popup exception list but there is no entry.

This ist the code in mozilla.cfg

//RhB-Popup Exceptions Components.utils.import("resource://gre/modules/Services.jsm"); var uri = Services.io.newURI("http://rhbekse", null, null); Services.perms.add(uri, "popup", 1); var uri = Services.io.newURI("http://rhberpws.intra.rhb.ch:8080", null, null); Services.perms.add(uri, "popup", 1); var uri = Services.io.newURI("http://rhberpwsint01.intra.rhb.ch:8080", null, null); Services.perms.add(uri, "popup", 1); var uri = Services.io.newURI("https://www.rhb.ch", null, null); Services.perms.add(uri, "popup", 1);

Did I do anything wrong?

thank you for any help

Hi there I have a mozilla.cfg file that configures some settings in Firefox. All the configurations are adapted except the popup configuration and the configurations bellow the popup-configuration. After firefox is installed I check the popup exception list but there is no entry. This ist the code in mozilla.cfg //RhB-Popup Exceptions Components.utils.import("resource://gre/modules/Services.jsm"); var uri = Services.io.newURI("http://rhbekse", null, null); Services.perms.add(uri, "popup", 1); var uri = Services.io.newURI("http://rhberpws.intra.rhb.ch:8080", null, null); Services.perms.add(uri, "popup", 1); var uri = Services.io.newURI("http://rhberpwsint01.intra.rhb.ch:8080", null, null); Services.perms.add(uri, "popup", 1); var uri = Services.io.newURI("https://www.rhb.ch", null, null); Services.perms.add(uri, "popup", 1); Did I do anything wrong? thank you for any help

Επιλεγμένη λύση

Moving to Firefox for Enterprise.

Note that you can no longer run privileged JavaScript in Firefox release versions (still works properly in ESR) because this code runs in a sandbox.

You can check the Browser Console for any messages related to the autoconfig file.

You can add this line to the autoconfig.js file that specifies using autoconfig.cfg

  • pref("general.config.sandbox_enabled", false);
Ανάγνωση απάντησης σε πλαίσιο 👍 0

Όλες οι απαντήσεις (6)

more options

So what kinda popups are showing?

more options

Επιλεγμένη λύση

Moving to Firefox for Enterprise.

Note that you can no longer run privileged JavaScript in Firefox release versions (still works properly in ESR) because this code runs in a sandbox.

You can check the Browser Console for any messages related to the autoconfig file.

You can add this line to the autoconfig.js file that specifies using autoconfig.cfg

  • pref("general.config.sandbox_enabled", false);
more options

Your code works for me,

more options

cor-el said

Moving to Firefox for Enterprise. Note that you can no longer run privileged JavaScript in Firefox release versions (still works properly in ESR) because this code runs in a sandbox. You can check the Browser Console for any messages related to the autoconfig file. You can add this line to the autoconfig.js file that specifies using autoconfig.cfg
  • pref("general.config.sandbox_enabled", false);

Isn't autoconfig.cfg only after the installation available? Where is the file?

more options

Since you stated that you use an autoconfig, I skipped the steps about the two required files. You can specify the name of the cfg file in the autoconfig.js and this file can have name. Currently the preferred name is autoconfig to get in line with the docs.

You can use the autoconfig.cfg file in the Firefox program folder to initialize (set/lock) preferences and run privileged JavaScript code.

The autoconfig.cfg file needs to be in the main Firefox program folder *https://support.mozilla.org/en-US/kb/customizing-firefox-using-autoconfig

This requires a autoconfig.js file in the "defaults/pref" folder where the channel-prefs.js file is located that specifies to use autoconfig.cfg.

//
pref("general.config.filename", "autoconfig.cfg");
pref("general.config.obscure_value", 0);
pref("general.config.sandbox_enabled", false);

The autoconfig.cfg and autoconfig.js files need to start with a comment line (//).

See Configuration:

more options

None of this Component importing in mozilla.cfg worked for me either (Ubuntu 18.04/Firefox 67) - I ended up digging through breadcrumbs in the Mozilla support site and discovered the solution is via Policy Settings, using the PopupBlocking policy.

The short how to:

  1. Create /usr/lib/firefox/distribution/policies.json
  2. Populate it as per below
  3. Validate your config by restarting the browser and going to about:policies

My policies.json:

{

 "policies": {
   "PopupBlocking": {
       "Allow": [
                 "http://popuptest.com",
                 "https://docs.google.com",
                 "https://drive.google.com",
                 "https://mail.google.com"
               ]
   }
 }

}


I've also documented this in a bit more detail on reddit: https://www.reddit.com/r/sysadmin/comments/c60t98/managing_firefox_popup_exceptions/