Categories
Technology

YesScript – A Firefox extension to allow blocking JavaScript for web sites SELECTIVELY

YesScript是我写的一个Firefox的扩展,允许用户有选择的屏蔽指定网站的JavaScript功能。虽然在Firefox选项对话框”Content”页面,用户通过选择”Enable JavaScript”打开或关闭JavaScript功能,但这种改变是针对所有网站,而不能选择性的屏蔽。

写YesScript的主要动力来自使用Google时的不便 – 用Firefox在登录Google后进行搜索,在返回的结果页面中,如果点击某个搜索结果的链接,Google会先把请求发送给自己(收集用户的选择偏好),然后再重定向到目的站点。由于在国内访问Google.com的不稳定性,常出现由于Google自身响应速度慢导致链接打开速度慢;实在慢的时候,我一般在搜索页面里面Copy & Paste 搜索结果链接到另外一个tab窗口中打开,跳过Google的用户反馈收集 – 这些都是Google页面中的JavaScript代码造成的。


Fig.1 Redirect URLs

好在Firefox提供了选择性过滤JavaScript的支持,它同时提供了“白名单”和“黑名单”的功能,分别针对指定网址有选择的开放和关闭指定网站的JavaScript功能,但此功能并未开放给用户直接使用。NoScript是一个Firefox插件,它实现了JavaScript“白名单”功能,即仅允许某些网站开启JavaScript功能,其余全部禁止。有关“黑名单”的插件,我在Web上搜了一下,没找到,才决心自己写一个。为了和NoScript的名称相对应,这个插件叫做YesScript 🙂

功能

YesScript是一个很简单的JavaScript“黑名单”插件,它的主要feature有:

  • 添加自定义“黑名单”,屏蔽名单中网站的JavaScript功能;
  • 功能开关,允许打开或者关闭YesScript,以便需要时临时恢复或者关闭JavaScript屏蔽功能;
  • 中、英文界面,根据Firefox语言版本自动切换。
  • 部署了远程更新RDF文件,供Firefox自动发现YesScript新版本并升级。

因为YesScript修改了Firefox的安全策略,所以任何改变,包括增加/删除黑名单上的站点;打开或者关闭YesScript都需要重启Firefox才能生效。

Fig.2 YesScript extension


Fig.3 Manage Blacklist

测试

我在Window XP (Firefox 1.5, 2.0)Ubuntu 6.1.0 (Firefox 2.0)上对YesScript进行了测试,均可正常工作。

考虑到公司知识产权相关规章制度,YesScript无法放到公网上下载,目前仅能开放给内部员工使用。

下载地址(IBM Internal)

YesScript Extension Installation

如有bug或者建议,可直接发mail找我 🙂

By Ling Zhang

本人服务于IBM中国软件实验室(上海)。本网页内容仅为个人思想,不代表IBM公司观点。

3 replies on “YesScript – A Firefox extension to allow blocking JavaScript for web sites SELECTIVELY”

[…] While Googling around I found that someone else once made an extension called YesScript. It’s a single blog entry by a guy named Zhang Ling, and the install link is broken. It looks like his YesScript worked just like my YesScript, except his additionally has a global on/off button. I’ve tried to contact him, but got no reply. From a Babelfish translation: Considered the company intellectual property rights related rules and regulations, YesScript is unable to put to male on-line downloading, at present only can open for the internal staff uses. […]

Leave a Reply

Your email address will not be published. Required fields are marked *

*