Lune

CCS2024Top-tier venue

Blocking Tracking JavaScript at the Function Granularity

Abdul Haddi Amjad, Shaoor Munir, Zubair Shafiq, Muhammad Ali Gulzar

Abstract

Modern websites extensively rely on JavaScript to implement both functionality and tracking. Existing privacy-enhancing content blocking tools struggle against mixed scripts, which simultaneously implement both functionality and tracking, because blocking the script would break functionality and not blocking it would allow tracking. We propose NoT.js, a fine-grained JavaScript blocking tool that operates at the function-level granularity. NoT.js's strengths lie in analyzing the dynamic execution context, including the call stack and calling context of each JavaScript function, and then encoding this context to build a rich graph representation. NoT.js trains a supervised machine learning classifier on a webpage's graph representation to first detect tracking at the JavaScript function-level and then automatically generate surrogate scripts that preserve functionality while removing tracking. Our evaluation of NoT.js on the top-10K websites demonstrates that it achieves high precision (94%) and recall (98%) in detecting tracking JavaScript functions, outperforming the state-of-the-art while being robust against offthe-shelf JavaScript obfuscation. Fine-grained detection of tracking functions allows NoT.js to automatically generate surrogate scripts that remove tracking JavaScript functions without causing major breakage. Our deployment of NoT.js shows that mixed scripts are present on 62.3% of the top-10K websites, with 70.6% of the mixed scripts being third-party that engage in tracking activities such as cookie ghostwriting. We share a sample of the tracking functions detected by NoT.js within mixed scripts-not currently on filter lists-with filter list authors, who confirm that these scripts are not blocked due to potential functionality breakage, despite being known to implement tracking.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

4 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Journey to the Center of the Cookie Ecosystem: Unraveling Actors' Roles and Relationships cites Tranco: A Research-Oriented Top Sites Ranking Hardened Against Manipulation
  • SoK: After Decades of Web Tracker Detection, What's Next? cites Detecting Filter List Evasion with Event-Loop-Turn Granularity JavaScript Signatures
  • SoK: After Decades of Web Tracker Detection, What's Next? cites AdGraph: A Graph-Based Approach to Ad and Tracker Blocking
  • SoK: After Decades of Web Tracker Detection, What's Next? cites Tranco: A Research-Oriented Top Sites Ranking Hardened Against Manipulation
  • Detecting Filter List Evasion with Event-Loop-Turn Granularity JavaScript Signatures cites AdGraph: A Graph-Based Approach to Ad and Tracker Blocking
  • Byte by Byte: Unmasking Browser Fingerprinting at the Function Level using V8 Bytecode Transformers cites Tranco: A Research-Oriented Top Sites Ranking Hardened Against Manipulation
  • Cookie Swap Party: Abusing First-Party Cookies for Web Tracking cites Journey to the Center of the Cookie Ecosystem: Unraveling Actors' Roles and Relationships
  • Users Pay Twice: The Hidden Energy Cost of Web Advertising cites Tranco: A Research-Oriented Top Sites Ranking Hardened Against Manipulation
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers4

  1. SoK: After Decades of Web Tracker Detection, What's Next?Wolf Rieder, Philip Raschke, Thomas Cory, Christian René Sechting et al.S&P 2026 · 1 citation
  2. Accessibility Issues in Ad-Driven Web ApplicationsAbdul Haddi Amjad, Muhammad Danish, Bless Jah, Muhammad Ali GulzarICSE 2025 · 1 citation
  3. Byte by Byte: Unmasking Browser Fingerprinting at the Function Level using V8 Bytecode TransformersPouneh Nikkhah Bahrami, Dylan Cutler, Igor BilogrevicCCS 2025
  4. Users Pay Twice: The Hidden Energy Cost of Web AdvertisingSamuel Pélissier, Naif Mehanna, Sterenn Roux, Quentin Perez et al.WWW 2026

Builds on11

  1. Tranco: A Research-Oriented Top Sites Ranking Hardened Against ManipulationVictor Le Pochat, Tom van Goethem, Samaneh Tajalizadehkhoob, Maciej Korczynski et al.NDSS 2019 · 826 citations
  2. AdGraph: A Graph-Based Approach to Ad and Tracker BlockingUmar Iqbal, Peter Snyder, Shitong Zhu, Benjamin Livshits et al.S&P 2020 · 112 citations
  3. Cookie Swap Party: Abusing First-Party Cookies for Web TrackingQuan Chen, Panagiotis Ilia, Michalis Polychronakis, Alexandros KapravelosWWW 2021 · 57 citations
  4. Journey to the Center of the Cookie Ecosystem: Unraveling Actors' Roles and RelationshipsIskander Sánchez-Rola, Matteo Dell'Amico, Davide Balzarotti, Pierre-Antoine Vervier et al.S&P 2022 · 35 citations
  5. Detecting Filter List Evasion with Event-Loop-Turn Granularity JavaScript SignaturesQuan Chen, Peter Snyder, Ben Livshits, Alexandros KapravelosS&P 2021 · 33 citations

Related papers

  1. ASTrack: Automatic Detection and Removal of Web Tracking Code with Minimal Functionality LossIsmael Castell-Uroz, Kensuke Fukuda, Pere Barlet-RosINFOCOM 2023 · 8 citations
  2. CookieGraph: Understanding and Detecting First-Party Tracking CookiesShaoor Munir, Sandra Deepthy Siby, Umar Iqbal, Steven Englehardt et al.CCS 2023 · 22 citations
  3. Read Between the Lines: Detecting Tracking JavaScript with Bytecode ClassificationMohammad Ghasemisharif, Jason PolakisCCS 2023 · 3 citations
  4. Unbundle-Rewrite-Rebundle: Runtime Detection and Rewriting of Privacy-Harming Code in JavaScript BundlesMir Masood Ali, Peter Snyder, Chris Kanich, Hamed HaddadiCCS 2024 · 2 citations
  5. AdCPG: Classifying JavaScript Code Property Graphs with Explanations for Ad and Tracker BlockingChangmin Lee, Sooel SonCCS 2023 · 7 citations
Dusk over the sea between two cliffs drawn in fine vertical lines