[Greasemonkey] Q: resolving relative URLs in Javascript

Nikolas Coukouma lists at atrus.org
Thu Jul 7 01:41:13 EDT 2005

Godmar Back wrote:

>I'd like to rewrite href's from within a greasemonkey script.
>Is there a Javascript function or method to obtain the full URL to
>which a given element's href would resolve?
> - Godmar
Yeah, use elem.href ;) Mozilla always resolved it. If you wanted the
unprocessed one, you'd have to use elem.getAttribute( "href" ).

-Nikolas Coukouma

More information about the Greasemonkey mailing list