On 11 January 2011 11:33, SZhang <[email protected]> wrote: > I would like to redirect from "www.foo.com/aaa" to "www.foo.com/aaa? > bbb" > > if I use window.location.href += "?bbb" > > it always load the page "www.foo.com/aaa" first, then jump to > "www.foo.com/aaa?bbb" > > How can I jump to "www.foo.com/aaa?bbb" directly when I input > "www.foo.com/aaa" in the urlbar and press enter? I know the extention > called "Redirector" can do this, but I want to implement this with GM > script
I don't think is possible. If the user type www.foo.com/aaa, that page will load, and you can't do anything about it. ONCE the page is load, and the onload-ish GM script is called, then you can redirect the user to a different page. the difference from what you want is minimal, since all the user will see is some screen flickering.... depending on how complex is "aaa" maybe you need a different strategy, if the user is clicking on aaaa on other page (like google, or a LAN app), rewrite these urls to aaa?bbb so the user never try to visit aaa -- -- ℱin del ℳensaje. -- You received this message because you are subscribed to the Google Groups "greasemonkey-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en.
