JSCleaner: De-Cluttering Mobile Webpages Through JavaScript Cleanup

A significant fraction of the World Wide Web suffers from the excessive usage of JavaScript (JS). Based on an analysis of popular webpages, we observed that a considerable number of JS elements utilized by these pages are not essential for their visual and functional features. In this paper, we propose JSCleaner, a JavaScript de-cluttering engine that aims at simplifying webpages without compromising their content or functionality. JSCleaner relies on a rule-based classification algorithm that classifies JS into three main categories: non-critical, replaceable, and critical. JSCleaner removes non-critical JS from a webpage, translates replaceable JS elements with their HTML outcomes, and preserves critical JS. Our quantitative evaluation of 500 popular webpages shows that JSCleaner achieves around 30% reduction in page load times coupled with a 50% reduction in the number of requests and the page size. In addition, our qualitative user study of 103 evaluators shows that JSCleaner preserves 95% of the page content similarity, while maintaining nearly 88% of the page functionality (the remaining 12% did not have a major impact on the user browsing experience).

[1]  Ankur Taly,et al.  An Operational Semantics for JavaScript , 2008, APLAS.

[2]  Daejun Park,et al.  KJS: a complete formal semantics of JavaScript , 2015, PLDI.

[3]  Hari Balakrishnan,et al.  Vesper: Measuring Time-to-Interactivity for Web Pages , 2018, NSDI.

[4]  Michael Pradel,et al.  Performance Issues and Optimizations in JavaScript: An Empirical Study , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).

[5]  David Wetherall,et al.  Demystifying Page Load Performance with WProf , 2013, NSDI.

[6]  Soo-Mook Moon,et al.  Snapshot-based Loading Acceleration of Web Apps with Nondeterministic JavaScript Execution , 2019, WWW.

[7]  Arthur Charguéraud,et al.  JSExplain: A Double Debugger for JavaScript , 2018, WWW.

[8]  Vyas Sekar,et al.  Understanding website complexity: measurements, metrics, and implications , 2011, IMC '11.

[9]  Nick Feamster,et al.  Community contribution award -- Measuring and mitigating web performance bottlenecks in broadband access networks , 2013, Internet Measurement Conference.

[10]  Michael Welzl,et al.  Can SPDY really make the web faster? , 2014, 2014 IFIP Networking Conference.

[11]  Hari Balakrishnan,et al.  Polaris: Faster Page Loads Using Fine-grained Dependency Tracking , 2016, NSDI.

[12]  Language Specification , 1995, The TSQL2 Temporal Query Language.

[13]  Lakshminarayanan Subramanian,et al.  Dissecting Web Latency in Ghana , 2014, Internet Measurement Conference.

[14]  Benjamin Livshits,et al.  SpeedReader: Reader Mode Made Fast and Private , 2018, WWW.

[15]  David Wetherall,et al.  Speeding up Web Page Loads with Shandian , 2016, NSDI.