[Greasemonkey] newsbie-question how to change and replace a link with greasemonkey

Gopalarathnam Venkatesan gopal at gopalarathnam.com
Mon Feb 6 18:13:44 EST 2006


On 2/6/06, Tina Weller <blond.woman at googlemail.com> wrote:
> Sorry, but the tip "\?" did not work. Perhaps another workaround is
> possible:
>
> At the moment the webpage contains links like this
>
> http://www.xyz.de?=vpath/data/index.php
>
> what I need is to change this into
>
> http://www.abc.de/data/index.php
>
> If it would be possible to tell greasemonkey to "Replace everything before
> /data through http://www.abc.de/"
> then I would not have the problem with the questionmark. Whiche lines in my
> script to I have to change, to reach this goal?
>
> Thanks a lot for your help
>
> Tina
>
>

Perhaps this helps:

var re = /(.*?)\?.*?(\/data.*)/;
link.replace(re, "$1$2");

--
Gopalarathnam Venkatesan
http://gopalarathnam.com/


More information about the Greasemonkey mailing list