Changes

Jump to: navigation, search

Security/Tracking protection

2,764 bytes added, 17:37, 21 May 2018
Engineering: Add a partial code walkthrough covering tracking annotations
* [https://github.com/mozilla/itisatrap itisatrap.org] test page
* [https://docs.google.com/document/d/1TxKCWn0qTgo0hnsKQINka-Jhm69nlbjbClgVWUHt22Y/edit Sandboxing trackers] (as an alternative to blocking)
 
=== Code walkthrough ===
 
Tracking annotations are used in four different places:
 
* [https://searchfox.org/mozilla-central/rev/d4b9e50875ad7e5d20f2fee6a53418315f6dfcc0/netwerk/base/nsChannelClassifier.cpp#1028-1030 lower the priority of tracker loads] in necko
* [https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/netwerk/protocol/http/nsHttpChannel.cpp#563-565 enable "tailing"] in necko
* the network predictor has a [https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/netwerk/base/Predictor.h#158 flag] to [https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/netwerk/base/Predictor.cpp#2673-2675 disable prefetching of tracking resources]
* the script loader set a [https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/dom/script/ScriptLoader.cpp#3166-3168) tracking flag] which gets [https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/dom/base/nsDocument.cpp#3234-3241 propagated to the document] to [https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/dom/base/nsDocument.cpp#3234-3241 keep track of tracking scripts]. There are three users of <tt>nsIDocument::IsTrackingScript()</tt>:
** the [https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/dom/base/TimeoutManager.cpp#541 Timeout Manager has an <tt>mIsTracking</tt> flag] to [https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/dom/base/TimeoutManager.cpp#605-609 distinguish tracking timeouts from regular ones] and [https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/dom/base/TimeoutManager.cpp#293-296 enforce a minimum timeout value] (<tt>dom.min_tracking_timeout_value</tt>) for [https://bugzilla.mozilla.org/show_bug.cgi?id=1325467 timeouts from a tracking script]
** [https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/dom/fetch/FetchDriver.h#164 Fetch uses it to set a flag] to honor [https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/dom/fetch/FetchDriver.cpp#692-695 tailing] and [https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/dom/fetch/FetchDriver.cpp#697-702 lowering networking priority] when [https://bugzilla.mozilla.org/show_bug.cgi?id=1312515 <tt>fetch()</tt> is called from a tracking script]
** XHR also [https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/dom/xhr/XMLHttpRequestMainThread.cpp#2431-2449 uses it for the same tailing and lowering the priority] features when the [https://bugzilla.mozilla.org/show_bug.cgi?id=1312515 XHR comes from a tracking script]
== Lists ==
Confirm
908
edits

Navigation menu