Re: Setting plugin activation state from addons
"David E. Ross" <[email protected]> Tue, 11 Mar 2014 14:51:45 -0700
| Newsgroups | gmane.comp.mozilla.devel.plugins |
|---|---|
| Organization | I am @ david at rossde dot com. |
| Message-ID | <[email protected]> |
On 3/11/2014 5:02 AM, Georg Fritzsche wrote: > Hi, > > some plugins are delivered to Firefox via XPIs. If you do that, you can add > per-site or global permissions for your plugin and don’t require any white- > listing. > > While we don’t have docs yet on the subject, here is an outline i put on bug > 982028: > > For adding the permissions (per site, preferred if possible) you would use > nsIPermissionManager.add() for every mimetype [1]. > * for the type param use nsIPluginManager.getPermissionStringForType(). > * the permission param should be Ci.nsIPermissionManager.ALLOW_ACTION > * expire type Ci.nsIPermissionManager.EXPIRE_NEVER or > Ci.nsIPermissionManager.EXPIRE_TIME > > You can see similar usage to that in our click-to-play code and check permissions.sqlite > in your profile folder [2]. > > Globally activating (avoid if possible to reduce exposure) a plugin would be done via > prefs, you can check about:config and filter for "plugin.state." for comparison. > > > Georg > > > [1] https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIPermissionManager#add%28%29 > [2] http://hg.mozilla.org//mozilla-central/annotate/67485526e241/browser/base/content/browser-plugins.js#l729 > Do you really mean plugins, or do you mean extensions? I have never seen a plugin installed from an .xpi file. -- David E. Ross <http://www.rossde.com/> On occasion, I filter and ignore all newsgroup messages posted through GoogleGroups via Google's G2/1.0 user agent because of spam, flames, and trolling from that source.