使用Firefox附加程序进行URL过滤

时间:2011-04-16 16:14:55

标签: javascript firefox-addon xpcom

在页面加载期间,有许多文档本身及其必需品的HTTP请求。如何挂钩它们,检索目标URL并阻止在满足某些条件时发送请求?插件也可以发出HTTP请求,我也想覆盖它们。

1 个答案:

答案 0 :(得分:0)

有多种方法可以发布重定向:

* Server-side: You configure your web server to issue a 300 HTTP response code (most commonly 301 ("moved permanently") or 302 ("found"/"moved temporarily")), with a Location header set to the new URL.
* Client-side: You include the http-equiv="refresh" attribute in the meta tag or set the JavaScript window.location  object (with or without the replace() method) in the head of the HTML document.