0

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.

Wayne
  • 58,261
  • 15
  • 130
  • 125
Xi Vix
  • 1,311
  • 5
  • 22
  • 41
  • This post might help: http://stackoverflow.com/questions/5205672/modify-url-before-loading-page-in-firefox/5207141#5207141 – Wayne Apr 13 '11 at 19:59

1 Answers1

0

on server that is processing your request try sending 301 response

for example an php redirect is like this

header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.example.com');
exit();
Troydm
  • 2,604
  • 3
  • 23
  • 34
  • oops ... I forgot to mention I have to do this in javascript. – Xi Vix Apr 13 '11 at 19:20
  • well there in javascript in order to not to kill all subsequent request the only way is to have this redirect be the last of all requests, i don't think there is any other way – Troydm Apr 13 '11 at 19:22