Closed Bug 1577040 Opened 5 years ago Closed 4 years ago

Eliminate the usage of nsIHttpChannel::IsTrackingResource()

Categories

(Core :: Privacy: Anti-Tracking, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

(Blocks 2 open bugs)

Details

Attachments

(8 files, 3 obsolete files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

Right now we have a bunch of usages of nsIHttpChannel::IsTrackingResource() combined with separate third-party checks. They're at best misleading and at worst introducing subtle bugs by doing the third-party checks slightly differently. Let's port all of them to IsThirdPartyTrackingResource().

Blocks: 1575811
No longer blocks: 1575811
Blocks: 1577123

There is a test failure on caused by part 2 of these patch series, see this try push:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=e54b5f0163fc2b8ceefe3ad1007b27bddd606d5b (the bc3/bc6 failures)

The failure is caused by this change. It is coming from this part of the anti-tracking tests which were added for bug 1504194.

The scenario is that our top-level page is example.net and the third-party page is another-tracking.example.net (both from the same eTLD+1). The third-party page is on the TP list so we classify it as a tracker but because the third-party checks determine that it is first-party wrt to the top-level page, we classify it as a first-party tracker. Hence the above change modifies the meaning of the code.

It seems to me that the best way to deal with this for now is to convert the nsContentUtils::IsTrackingResourceWindow() call to a function which checks the classification flags directly ignoring the first/third-party-ness.

Does that sound good?

Flags: needinfo?(amarchesini)

There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:ehsan, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(ehsan)

baku: ping???

Flags: needinfo?(ehsan)

It seems to me that the best way to deal with this for now is to convert the nsContentUtils::IsTrackingResourceWindow() call to a function which checks the classification flags directly ignoring the first/third-party-ness.

It took me a while to answer. Sorry. Yes, what you propose should work correctly. Do you want me to continue these patches?

Flags: needinfo?(amarchesini) → needinfo?(ehsan)

(In reply to Andrea Marchesini [:baku] from comment #7)

It seems to me that the best way to deal with this for now is to convert the nsContentUtils::IsTrackingResourceWindow() call to a function which checks the classification flags directly ignoring the first/third-party-ness.

It took me a while to answer. Sorry. Yes, what you propose should work correctly. Do you want me to continue these patches?

That would be great, if you don't mind. I kept rebasing these patches for a few months but then I gave up and deleted them from my queue... :-(

Flags: needinfo?(ehsan)
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c19bec23d39d
Part 0: nsIClassifiedChannel.isThirdPartySocialTrackingResource(), r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/e9bf54da2df4
Part 1: Remove the usages of nsIHttpChannel::IsTrackingResource() in the cookie service, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/273ce1bb372a
Part 2: Remove nsContentUtils::IsTrackingResourceWindow() and replace its calls with IsThirdPartyTrackingResourceWindow(), r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/cb55df34c744
Part 3: Replace nsIHttpChannel.isTrackingResource() with isThirdPartyTrackingResource() in the url-classifier tests, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/a4970ef2e4e2
Part 4: Get rid of nsIClassifiedChannel::IsSocialTrackingResource(), r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/d4997121ca63
Part 5: Remove nsContentUtils::IsTrackingResource() from anti-tracking, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/669f02d2e979
Part 6: Fix a couple of tests, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/31c9eed2f159
Part 7: Get rid of nsIClassifiedChanel::IsTrackingResource(), r=Ehsan
Attachment #9088600 - Attachment is obsolete: true
Attachment #9088599 - Attachment is obsolete: true
Attachment #9088598 - Attachment is obsolete: true
Regressions: 1619964
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: