Bug 1773695 - Part 2: Add flags for the email tracking protections. r=dimi

Differential Revision: https://phabricator.services.mozilla.com/D151049
This commit is contained in:
Tim Huang 2022-07-18 21:48:15 +00:00
parent bf66ae0486
commit 86d982dc94
6 changed files with 20 additions and 0 deletions

View File

@ -245,6 +245,7 @@ XPC_MSG_DEF(NS_ERROR_HARMFUL_URI , "The URI is harmful")
XPC_MSG_DEF(NS_ERROR_FINGERPRINTING_URI , "The URI is fingerprinting")
XPC_MSG_DEF(NS_ERROR_CRYPTOMINING_URI , "The URI is cryptomining")
XPC_MSG_DEF(NS_ERROR_SOCIALTRACKING_URI , "The URI is social tracking")
XPC_MSG_DEF(NS_ERROR_EMAILTRACKING_URI , "The URI is email tracking")
/* Profile manager error codes */
XPC_MSG_DEF(NS_ERROR_DATABASE_CHANGED , "Flushing the profiles to disk would have overwritten changes made elsewhere.")

View File

@ -122,6 +122,12 @@ interface nsIClassifiedChannel : nsISupports
CLASSIFIED_SOCIALTRACKING_LINKEDIN = 0x0800,
CLASSIFIED_SOCIALTRACKING_TWITTER = 0x1000,
/**
* The following are about email tracking.
*/
CLASSIFIED_EMAILTRACKING = 0x2000,
CLASSIFIED_EMAILTRACKING_CONTENT = 0x4000,
/**
* This is exposed to help to identify tracking classification using the
* basic lists.

View File

@ -1326,6 +1326,7 @@ interface nsILoadInfo : nsISupports
const uint32_t BLOCKING_REASON_CLASSIFY_CRYPTOMINING_URI = 2007;
const uint32_t BLOCKING_REASON_CLASSIFY_FINGERPRINTING_URI = 2008;
const uint32_t BLOCKING_REASON_CLASSIFY_SOCIALTRACKING_URI = 2009;
const uint32_t BLOCKING_REASON_CLASSIFY_EMAILTRACKING_URI = 2010;
const uint32_t BLOCKING_REASON_MIXED_BLOCKED = 3001;
// The general reason comes from nsCSPContext::permitsInternal(),
// which is way too generic to distinguish an exact reason.

View File

@ -298,6 +298,9 @@ static const BlockingErrorCode sBlockingErrorCodes[] = {
{NS_ERROR_SOCIALTRACKING_URI,
nsIWebProgressListener::STATE_BLOCKED_SOCIALTRACKING_CONTENT,
"TrackerUriBlocked", "Tracking Protection"_ns},
{NS_ERROR_EMAILTRACKING_URI,
nsIWebProgressListener::STATE_BLOCKED_EMAILTRACKING_CONTENT,
"TrackerUriBlocked", "Tracking Protection"_ns},
};
} // namespace

View File

@ -324,6 +324,12 @@ interface nsIWebProgressListener : nsISupports
*
* STATE_ALLOWED_TRACKING_CONTENT
* Tracking content which should be blocked from loading was allowed.
*
* STATE_BLOCKED_EMAILTRACING_CONTENT
* EmailTracking content has been blocked from loading.
*
* STATE_LOADED_EMAILTRACKING_CONTENT
* EmailTracking content has been loaded.
*/
const unsigned long STATE_BLOCKED_TRACKING_CONTENT = 0x00001000;
const unsigned long STATE_LOADED_LEVEL_1_TRACKING_CONTENT = 0x00002000;
@ -346,6 +352,8 @@ interface nsIWebProgressListener : nsISupports
const unsigned long STATE_LOADED_SOCIALTRACKING_CONTENT = 0x00020000;
const unsigned long STATE_REPLACED_TRACKING_CONTENT = 0x00000010;
const unsigned long STATE_ALLOWED_TRACKING_CONTENT = 0x00000020;
const unsigned long STATE_BLOCKED_EMAILTRACKING_CONTENT = 0x00400000;
const unsigned long STATE_LOADED_EMAILTRACKING_CONTENT = 0x00800000;
/**
* Flag for HTTPS-Only Mode upgrades

View File

@ -945,6 +945,7 @@ with modules["URILOADER"]:
errors["NS_ERROR_FINGERPRINTING_URI"] = FAILURE(41)
errors["NS_ERROR_CRYPTOMINING_URI"] = FAILURE(42)
errors["NS_ERROR_SOCIALTRACKING_URI"] = FAILURE(43)
errors["NS_ERROR_EMAILTRACKING_URI"] = FAILURE(44)
# Used when "Save Link As..." doesn't see the headers quickly enough to
# choose a filename. See nsContextMenu.js.
errors["NS_ERROR_SAVE_LINK_AS_TIMEOUT"] = FAILURE(32)