Filters For "Perm-Changed"

3 views
Skip to first unread message

Jason Bratcher

unread,
May 25, 2012, 5:54:28 PM5/25/12
to Noise
Does Perm-Changed take any filter codes?
I.E., for always ask, Block, or Allow?
The function without filters is very freakish on thiw end;
Prefer 3 separate sounds to indicate asking, allowing, or blocking.
Found this out in "About:Permissions" while changing the various drop boxes for the listed sites.

bootleq

unread,
May 25, 2012, 7:22:04 PM5/25/12
to noise-firef...@googlegroups.com
Yes, it has, but is hard to use.

In this filter,
You can get 'data' as "delete", "added", "changed" or "cleared".
(reference: https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIPermissionManager#Remarks)
And a 'subject' object which have permission attributes:
https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIPermission#Attributes

This hacks too much, but you can use, for example:
perm-changed&data==='changed'&&subject.QueryInterface(Components.interfaces.nsIPermission).capability===Components.interfaces.nsIPermissionManager.ALLOW_ACTION
When you change a premission to "allowed", nsIPermissionManager.ALLOW_ACTION will be 1. (you can write 1, instead of nsIPermissionManager.ALLOW_ACTION)

The problem is, in about:permissions, not all 'allowed' is 1,
I must use
perm-changed&Noise.log(subject.QueryInterface(Components.interfaces.nsIPermission).capability)
and open debug console to see what is the value for each option.

2012/5/26 Jason Bratcher <imco...@gmail.com>

--
您已訂閱「Google 網上論壇」的「Noise (Firefox Extension)」群組,因此我們特別傳送這封郵件通知您。
如要在此群組張貼留言,請傳送電子郵件至 noise-firef...@googlegroups.com
如要取消訂閱此群組,請傳送電子郵件至 noise-firefox-ext...@googlegroups.com
如需更多選項,請造訪此群組:http://groups.google.com/group/noise-firefox-extension?hl=zh-TW

Reply all
Reply to author
Forward
0 new messages