Bug 1484876 - Part 4: Remove nsIPrivateBrowsingTrackingProtectionWhitelist.existsInAllowList(); r=johannh

This commit is contained in:
Ehsan Akhgari 2018-08-21 09:55:49 -04:00
parent c4e0a11824
commit 3070297f6f
4 changed files with 5 additions and 30 deletions

View File

@ -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);

View File

@ -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");

View File

@ -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++

View File

@ -60,10 +60,6 @@ var PrivateBrowsingUtils = {
gPBMTPWhitelist.addToAllowList(aURI);
},
existsInTrackingAllowlist(aURI) {
return gPBMTPWhitelist.existsInAllowList(aURI);
},
removeFromTrackingAllowlist(aURI) {
gPBMTPWhitelist.removeFromAllowList(aURI);
},