mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 1484876 - Part 4: Remove nsIPrivateBrowsingTrackingProtectionWhitelist.existsInAllowList(); r=johannh
This commit is contained in:
parent
c4e0a11824
commit
3070297f6f
@ -412,13 +412,11 @@ var ContentBlocking = {
|
||||
}
|
||||
|
||||
// Check whether the user has added an exception for this site.
|
||||
let hasException = false;
|
||||
if (PrivateBrowsingUtils.isBrowserPrivate(gBrowser.selectedBrowser)) {
|
||||
hasException = PrivateBrowsingUtils.existsInTrackingAllowlist(baseURI);
|
||||
} else {
|
||||
hasException = Services.perms.testExactPermission(baseURI,
|
||||
"trackingprotection") == Services.perms.ALLOW_ACTION;
|
||||
}
|
||||
let type = PrivateBrowsingUtils.isBrowserPrivate(gBrowser.selectedBrowser) ?
|
||||
"trackingprotection-pb" :
|
||||
"trackingprotection";
|
||||
let hasException = Services.perms.testExactPermission(baseURI, type) ==
|
||||
Services.perms.ALLOW_ACTION;
|
||||
|
||||
this.content.toggleAttribute("detected", detected);
|
||||
this.content.toggleAttribute("hasException", hasException);
|
||||
|
@ -35,17 +35,6 @@ PrivateBrowsingTrackingProtectionWhitelist.prototype = {
|
||||
Services.perms.remove(uri, "trackingprotection-pb");
|
||||
},
|
||||
|
||||
/**
|
||||
* Check if the provided URI exists in the list of allowed tracking sites.
|
||||
*
|
||||
* @param uri nsIURI
|
||||
* The URI to add to the list.
|
||||
*/
|
||||
existsInAllowList(uri) {
|
||||
return Services.perms.testPermission(uri, "trackingprotection-pb") ==
|
||||
Ci.nsIPermissionManager.ALLOW_ACTION;
|
||||
},
|
||||
|
||||
observe(subject, topic, data) {
|
||||
if (topic == "last-pb-context-exited") {
|
||||
Services.perms.removeByType("trackingprotection-pb");
|
||||
|
@ -31,14 +31,6 @@ interface nsIPrivateBrowsingTrackingProtectionWhitelist : nsISupports
|
||||
* @param uri the uri to remove from the list
|
||||
*/
|
||||
void removeFromAllowList(in nsIURI uri);
|
||||
|
||||
/**
|
||||
* Check if a URI exists in the list of allowed tracking sites in Private
|
||||
* Browsing mode (the tracking whitelist).
|
||||
*
|
||||
* @param uri the uri to look for in the list
|
||||
*/
|
||||
bool existsInAllowList(in nsIURI uri);
|
||||
};
|
||||
|
||||
%{ C++
|
||||
|
@ -60,10 +60,6 @@ var PrivateBrowsingUtils = {
|
||||
gPBMTPWhitelist.addToAllowList(aURI);
|
||||
},
|
||||
|
||||
existsInTrackingAllowlist(aURI) {
|
||||
return gPBMTPWhitelist.existsInAllowList(aURI);
|
||||
},
|
||||
|
||||
removeFromTrackingAllowlist(aURI) {
|
||||
gPBMTPWhitelist.removeFromAllowList(aURI);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user