Giter VIP home page Giter VIP logo

autopermission's Introduction

Download link: https://addons.mozilla.org/firefox/addon/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.<identifier>", "<origin_or_host>: <type1>=<value1>, <type2>=<value2>, ...");

For example:

pref("extensions.autopermission.sites.www.example.com", "popup=1, geo=2, install=2");
pref("extensions.autopermission.sites.test", "test.example.com: popup=1, geo=2, install=2");
pref("extensions.autopermission.sites.test-secure", "https://test.example.com:8080: popup=1");

Any character is available for the identifier, if it is acceptable as a preference name specified as an UTF-8 bytes array. You need to use the format when you hope to apply new permissions only for "https:" version webpages.

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.
  • push: Allow websites to notify users of new messages or updated content.

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_DEFAULT = 0;
var PERM_ALLOW   = 1;
var PERM_DENY    = 2;

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

// permissions for trusted sites
pref("extensions.autopermission.policy.trusted.camera",         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);
pref("extensions.autopermission.policy.trusted.push",           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);

autopermission's People

Contributors

cosmo0920 avatar mooz avatar piroor avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

autopermission's Issues

First-party / Third-party cookies permissions

The current implementation only allows for a toggle of the cookie state per site on or off. Can you add the ability to allow three states per site: on, off, or first-party-only? Thank you!

Add permission for notifications

Can you add a way to change whether or notifications are allowed for a domain? It can work the same way as how the extension allows enabling/disabling everything else.

Broken in Firefox 44.0

@piroor Version 2.2 got this working in Firefox 42. Thank you!

But now in Firefox 44.0, it is broken again.

None of the permissions are getting applied.

Can you fix?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.