论文标题

JSERHAB:从JavaScript成瘾中断奶通用的Web界面组件

JSRehab: Weaning Common Web Interface Components from JavaScript Addiction

论文作者

Fouquet, Romain, Laperdrix, Pierre, Rouvoy, Romain

论文摘要

多年来,利用JavaScript(JS)进行用户界面(UI)交互性一直是网络上的规范。但是,使用JS增加带宽和电池消耗,因为浏览器需要下载和处理脚本。另外,客户端JS可以将访问者暴露于安全漏洞(例如跨站点脚本(XSS))。本文引入了一个新的服务器端插件,称为JSERHAB,该插件将通过不需要任何JavaScript(JS)的替代方案自动重写常见的Web接口组件。 Jsrehab的主要目的是大幅度减少并最终将JS纳入网页,以提高其响应能力并消耗更少的资源。我们报告了我们针对Bootstrap的JS-REHAB实施,这是迄今为止最受欢迎的UI框架,并在100个网页的语料库中对其进行了评估。我们通过手动验证表明,确实可以降低页面对JS的依赖性,同时保持其完整的交互性和可访问性。我们观察到,Jsrehab在测试设备上为大多数网页带来了至少5%的能源节省,同时在HTML有效载荷中引入了仅5%的线开销。

Leveraging JavaScript (JS) for User Interface (UI) interactivity has been the norm on the web for many years. Yet, using JS increases bandwidth and battery consumption as scripts need to be downloaded and processed by the browser. Plus, client-side JS may expose visitors to security vulnerabilities such as Cross-Site Scripting (XSS).This paper introduces a new server-side plugin, called JSRehab, that automatically rewrites common web interface components by alternatives that do not require any JavaScript (JS). The main objective of JSRehab is to drastically reduce-and ultimately remove-the inclusion of JS in a web page to improve its responsiveness and consume less resources. We report on our implementation of JS-Rehab for Bootstrap, the most popular UI framework by far, and evaluate it on a corpus of 100 webpages. We show through manual validation that it is indeed possible to lower the dependencies of pages on JS while keeping intact its interactivity and accessibility. We observe that JSRehab brings energy savings of at least 5 % for the majority of web pages on the tested devices, while introducing a median on-the-wire overhead of only 5 % to the HTML payload.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源