Hi, I'm writing a firefox addon, and if certain conditions are met, id like to rewrite the URL. Right now its being done in the following fashion
if(checkUrl(document.location.href))
{
document.location.replace('xyz.com');
}
the problem with this is that the old page loads, then the condition is met, and only then is the user redirected.
Is there a way to do this before the page loads? i.e., once the user has typed in the url and hit enter (or clicked?)
Thanks!