替换HTTP请求
我需要重定向 http 请求作为过滤器插件的一部分。
我正在使用 nsIObserverService
,它为我提供主题、主题和数据。
我知道如何取消请求,但我需要将请求替换为阻止页面的 URL。
我知道如何使用 window.content.document.location.replace
重定向窗口内容,但这会终止所有后续请求。
我只想在请求级别进行替换。
请指教。
提前致谢。
I need to redirect http request as part of a filter addon.
I am using an nsIObserverService
which provides me with subject, topic, and data.
I know how to cancel the request but I need to replace the request with a URL to a block page.
I know how to redirect the window contents with window.content.document.location.replace
but that kills all subsequent requests.
I only want to replace at the request level.
Please advise.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在正在处理您的请求的服务器上尝试发送 301 响应,
例如 php 重定向如下
on server that is processing your request try sending 301 response
for example an php redirect is like this