Closed Bug 358685 Opened 19 years ago Closed 17 years ago

request for a code change or new method in nsIPermissionManager

Categories

(Core :: General, enhancement)

x86
Windows XP
enhancement
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: linuxed7, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0 The only way to test whether an exception is saved for a certain domain is by using the testPermission() method of the nsIPermissionManager object. The downside of using that method is that it only tells you whether the website can set cookies, it doesn't tell you the actual domain name being used in the exceptions list. I would prefer that the testPermission() method returned an nsIPermission object instead of just the exception capability. That way you could retrieve the host name and the capability of the nsIPermission object. For example, if you test the permission of http://sub.domain.com and there is an exception saved to allow cookies for domain.com then the testPermission() method will return the capability of 1 for sub.domain.com. Unfortunately you have no way of determining the actual host name that is saved in the exceptions list. It could be the full domain or the base domain. And in the example above the host sub.domain.com doesn't appear in the exceptions list yet the testPermission() method will return the capability of the base domain exception. If it is not possible to change the value that the testPermission() method returns then perhaps a new method could be added to the nsIPermissionManager object. It would be great if there was a testException(String) method that took a string argument representing the domain name and returned a boolean value indicating whether that exact domain name appeared in the exceptions list. True = found, False = not found. Currently the only way to accomplish that is to loop through the entire exceptions list while comparing each host name to a predefined variable. And for users who have a list of exceptions numbering in the thousands, especially if they are using a program like SpywareBlaster to create a blocked exceptions list then it usually takes quite a while to loop through all of the exceptions. The testPermission() method accomplishes that task quickly but there's no way to determine which host the capability it returns is referring to. Reproducible: Always
There is now "textExactPermission()" exposed. Or you can just get the enumerator object and get all of the nsIPermission objects at once. This is unnecessary, between those two objects you have what you need.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Product: Firefox → Core
QA Contact: general → general
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.