зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 3 changesets (bug 1566961) for eslint failure on browser_socialtracking.js. CLOSED TREE
Backed out changeset a85686cb5dfa (bug 1566961) Backed out changeset 9cb916e52712 (bug 1566961) Backed out changeset 4c747eb1c370 (bug 1566961)
This commit is contained in:
Родитель
ff5f28adeb
Коммит
755219489e
|
@ -5449,13 +5449,6 @@
|
|||
value: false
|
||||
mirror: always
|
||||
|
||||
# Consider socialtracking annotation as trackers (see ETP)
|
||||
- name: privacy.socialtracking.block_cookies.enabled
|
||||
type: bool
|
||||
value: false
|
||||
mirror: always
|
||||
|
||||
|
||||
# Whether origin telemetry should be enabled
|
||||
# NOTE: if telemetry.origin_telemetry_test_mode.enabled is enabled, this pref
|
||||
# won't have any effect.
|
||||
|
|
|
@ -561,6 +561,7 @@ interface nsIHttpChannel : nsIChannel
|
|||
CLASSIFIED_SOCIALTRACKING_FACEBOOK = 0x0200,
|
||||
CLASSIFIED_SOCIALTRACKING_LINKEDIN = 0x0400,
|
||||
CLASSIFIED_SOCIALTRACKING_TWITTER = 0x0800,
|
||||
CLASSIFIED_SOCIALTRACKING_YOUTUBE = 0x1000,
|
||||
|
||||
/**
|
||||
* This is exposed to help to identify tracking classification using the
|
||||
|
@ -576,14 +577,6 @@ interface nsIHttpChannel : nsIChannel
|
|||
*/
|
||||
CLASSIFIED_ANY_STRICT_TRACKING = CLASSIFIED_ANY_BASIC_TRACKING |
|
||||
CLASSIFIED_TRACKING_CONTENT | CLASSIFIED_FINGERPRINTING_CONTENT,
|
||||
|
||||
/**
|
||||
* This is exposed to help to identify social tracking classification
|
||||
* flags.
|
||||
*/
|
||||
CLASSIFIED_ANY_SOCIAL_TRACKING = CLASSIFIED_SOCIALTRACKING |
|
||||
CLASSIFIED_SOCIALTRACKING_FACEBOOK |
|
||||
CLASSIFIED_SOCIALTRACKING_LINKEDIN | CLASSIFIED_SOCIALTRACKING_TWITTER,
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -501,18 +501,11 @@ bool UrlClassifierCommon::IsAllowListed(
|
|||
|
||||
// static
|
||||
bool UrlClassifierCommon::IsTrackingClassificationFlag(uint32_t aFlag) {
|
||||
if (StaticPrefs::privacy_annotate_channels_strict_list_enabled() &&
|
||||
(aFlag &
|
||||
nsIHttpChannel::ClassificationFlags::CLASSIFIED_ANY_STRICT_TRACKING)) {
|
||||
return true;
|
||||
if (StaticPrefs::privacy_annotate_channels_strict_list_enabled()) {
|
||||
return (
|
||||
aFlag &
|
||||
nsIHttpChannel::ClassificationFlags::CLASSIFIED_ANY_STRICT_TRACKING);
|
||||
}
|
||||
|
||||
if (StaticPrefs::privacy_socialtracking_block_cookies_enabled() &&
|
||||
(aFlag &
|
||||
nsIHttpChannel::ClassificationFlags::CLASSIFIED_ANY_SOCIAL_TRACKING)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return (aFlag &
|
||||
nsIHttpChannel::ClassificationFlags::CLASSIFIED_ANY_BASIC_TRACKING);
|
||||
}
|
||||
|
|
|
@ -149,6 +149,9 @@ UrlClassifierFeatureSocialTrackingAnnotation::ProcessChannel(
|
|||
{NS_LITERAL_CSTRING("social-tracking-protection-twitter-"),
|
||||
nsIHttpChannel::ClassificationFlags::
|
||||
CLASSIFIED_SOCIALTRACKING_TWITTER},
|
||||
{NS_LITERAL_CSTRING("social-tracking-protection-youtube-"),
|
||||
nsIHttpChannel::ClassificationFlags::
|
||||
CLASSIFIED_SOCIALTRACKING_YOUTUBE},
|
||||
};
|
||||
|
||||
uint32_t flags = UrlClassifierCommon::TablesToClassificationFlags(
|
||||
|
|
|
@ -30,8 +30,6 @@ support-files =
|
|||
3rdPartyStorage.html
|
||||
3rdPartyStorageWO.html
|
||||
3rdPartyPartitioned.html
|
||||
localStorage.html
|
||||
raptor.jpg
|
||||
!/browser/modules/test/browser/head.js
|
||||
!/browser/base/content/test/general/head.js
|
||||
|
||||
|
@ -110,6 +108,7 @@ skip-if = fission
|
|||
[browser_denyPermissionForTracker.js]
|
||||
[browser_localStorageEvents.js]
|
||||
skip-if = fission
|
||||
support-files = localStorage.html
|
||||
[browser_partitionedLocalStorage.js]
|
||||
skip-if = fission
|
||||
[browser_partitionedLocalStorage_events.js]
|
||||
|
@ -134,5 +133,3 @@ support-files = matchAll.js
|
|||
[browser_partitionedSharedWorkers.js]
|
||||
skip-if = fission
|
||||
support-files = sharedWorker.js partitionedSharedWorker.js
|
||||
[browser_socialtracking.js]
|
||||
skip-if = fission
|
||||
|
|
|
@ -1,110 +0,0 @@
|
|||
function runTest(obj) {
|
||||
add_task(async _ => {
|
||||
info("Test: " + obj.testName);
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["dom.ipc.processCount", 1],
|
||||
["network.cookie.cookieBehavior", Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER],
|
||||
["privacy.trackingprotection.enabled", false],
|
||||
["privacy.trackingprotection.pbmode.enabled", false],
|
||||
["privacy.trackingprotection.annotate_channels", true],
|
||||
["privacy.storagePrincipal.enabledForTrackers", false],
|
||||
["urlclassifier.features.socialtracking.annotate.blacklistHosts", "not-tracking.example.com"],
|
||||
["privacy.trackingprotection.socialtracking.annotate.enabled", obj.annotationEnabled],
|
||||
["urlclassifier.features.socialtracking.blacklistHosts", "not-tracking.example.com"],
|
||||
["privacy.trackingprotection.socialtracking.enabled", obj.protectionEnabled],
|
||||
["privacy.socialtracking.block_cookies.enabled", obj.cookieBlocking],
|
||||
],
|
||||
});
|
||||
|
||||
await UrlClassifierTestUtils.addTestTrackers();
|
||||
|
||||
info("Creating a non-tracker top-level context");
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, TEST_TOP_PAGE);
|
||||
let browser = gBrowser.getBrowserForTab(tab);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
info("The non-tracker page opens a tracker iframe");
|
||||
await ContentTask.spawn(
|
||||
browser,
|
||||
{
|
||||
page: TEST_4TH_PARTY_DOMAIN + TEST_PATH + "localStorage.html",
|
||||
image: TEST_4TH_PARTY_DOMAIN + TEST_PATH + "raptor.jpg",
|
||||
loading: obj.loading,
|
||||
result: obj.result,
|
||||
},
|
||||
async obj => {
|
||||
let loading = await new content.Promise(resolve => {
|
||||
let image = new content.Image();
|
||||
image.src = obj.image + "?" + Math.random();
|
||||
image.onload = _ => resolve(true);
|
||||
image.onerror = _ => resolve(false);
|
||||
});
|
||||
|
||||
is(loading, obj.loading, "Loading expected");
|
||||
|
||||
if (obj.loading) {
|
||||
let ifr = content.document.createElement("iframe");
|
||||
ifr.setAttribute("id", "ifr");
|
||||
ifr.setAttribute("src", obj.page);
|
||||
|
||||
info("Iframe loading...");
|
||||
await new content.Promise(resolve => {
|
||||
ifr.onload = resolve;
|
||||
content.document.body.appendChild(ifr);
|
||||
});
|
||||
|
||||
let p = new Promise(resolve => {
|
||||
content.addEventListener("message", e => { resolve(e.data); },
|
||||
{ once: true });
|
||||
});
|
||||
|
||||
info("Setting localStorage value...");
|
||||
ifr.contentWindow.postMessage("test", "*");
|
||||
|
||||
info("Getting the value...");
|
||||
let value = await p;
|
||||
is(value.status, obj.result, "We expect to succeed");
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
});
|
||||
}
|
||||
|
||||
runTest({
|
||||
testName: "Socialtracking-annotation feature not enabled",
|
||||
annotationEnabled: false,
|
||||
protectionEnabled: false,
|
||||
loading: true,
|
||||
cookieBlocking: false,
|
||||
result: true,
|
||||
});
|
||||
|
||||
runTest({
|
||||
testName: "Socialtracking-annotation feature enabled but not considered for tracking detection.",
|
||||
annotationEnabled: true,
|
||||
protectionEnabled: false,
|
||||
loading: true,
|
||||
cookieBlocking: false,
|
||||
result: true,
|
||||
});
|
||||
|
||||
runTest({
|
||||
testName: "Socialtracking-annotation feature enabled and considered for tracking detection.",
|
||||
annotationEnabled: true,
|
||||
protectionEnabled: false,
|
||||
loading: true,
|
||||
cookieBlocking: true,
|
||||
result: false,
|
||||
});
|
||||
|
||||
runTest({
|
||||
testName: "Socialtracking-protection feature enabled.",
|
||||
annotationEnabled: true,
|
||||
protectionEnabled: true,
|
||||
loading: false,
|
||||
cookieBlocking: true,
|
||||
result: false,
|
||||
});
|
Двоичные данные
toolkit/components/antitracking/test/browser/raptor.jpg
Двоичные данные
toolkit/components/antitracking/test/browser/raptor.jpg
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 48 KiB |
Загрузка…
Ссылка в новой задаче