Permissions Auto Registerer


# How to use

Define a preference for websites, like:

pref("extensions.autopermission.sites.<domain>", "<type1>=<value1>, <type2>=<value2>, ...");
pref("extensions.autopermission.sites.<key>", "<domain>: <type1>=<value1>, <type2>=<value2>, ...");

For example:

pref("", "popup=1, geo=2, install=2");
pref("extensions.autopermission.sites.test-item", " popup=1, geo=2, install=2");

To confirm permissions are correctly applied, see about:permissions.

Available types are:

* `password`: Allow to save passwords to the password manager.
* `geo`: Allow to access to the geolication API.
* `cookie`: Allow to store Cookie.
* `popup`: Allow to open popup windows (ads, etc.)
* `indexedDB`: Allow to use offline storages.
* `fullscreen`: Allow to activate DOM fullscreen.
* `image`: Allow to load image files.
* `install`: Allow to install addons.
* `offline-app`: Allow to use offline-cache for web applications.
* `camera`: Allow to access camera devices.
* `microphone`: Allow to access microphone devices.

Available vlaues are:

* `0`: Unknown. (clear the stored value and follow to the default preference)
* `1`: Allow all.
* `2`: Deny all.

For Cookies, there are more choices:

* `0`: Unknown. (clear the stored value and follow to the default preference)
* `1`: Allow all cookies permanently.
* `2`: Deny all cookies permanently.
* `8`: Allow all cookies only for the current session.
* `9`: Allow first party cookies permanently, and deny all others.
* `10`: Allow first party cookies permanently, and allow third party cookeis also permanently only when they are already accepted.

This is mainly designed for corporate-use.

# Usecase for MCD

You can control permissions like a security policy, with MCD.
For example:

var PERM_ALLOW = 1;
var PERM_DENY = 2;

// list of trusted sites
pref("extensions.autopermission.policy.trusted.sites", ",");

// permissions for trusted sites
pref("", PERM_ALLOW);
pref("extensions.autopermission.policy.trusted.cookie", PERM_ALLOW);
pref("extensions.autopermission.policy.trusted.fullscreen", PERM_ALLOW);
pref("extensions.autopermission.policy.trusted.geo", PERM_ALLOW);
pref("extensions.autopermission.policy.trusted.image", PERM_ALLOW);
pref("extensions.autopermission.policy.trusted.indexedDB", PERM_ALLOW);
pref("extensions.autopermission.policy.trusted.install", PERM_ALLOW);
pref("extensions.autopermission.policy.trusted.microphone", PERM_ALLOW);
pref("extensions.autopermission.policy.trusted.offline-app", PERM_ALLOW);
pref("extensions.autopermission.policy.trusted.password", PERM_ALLOW);
pref("extensions.autopermission.policy.trusted.popup", PERM_ALLOW);

// special permissions for trusted sites, based on Firefox's capability settings
// allow/deny to run scripts in the site
pref("extensions.autopermission.policy.trusted.javascript", PERM_ALLOW);
// allow/deny links to locak files
pref("extensions.autopermission.policy.trusted.localfilelinks", PERM_ALLOW);

Download files:


This page is part of the LegacyCollector website.
Disclaimer: All material on this site is property of their respective owners and available under
open licenses to the best of our knowledge. If you are an author and would like anything removed,
then please write an e-mail to legacy [at] collector dot org.