[Greasemonkey] FF 1.5RC1/GM 0.6.3 Issue with User Script
Jeremy Dunck
jdunck at gmail.com
Wed Nov 9 22:43:07 EST 2005
On 11/8/05, Randy H. Tjahjono <mysubscriptions at pobox.com> wrote:
> With 0.5.3, when the following code is injected, it returns the entire URL, including file name (e.g., http://example.com/foo/bar/foobar.html). However, it now returns the URL without the file name (http://www.example.com/foo/bar). I am not sure if this is due to 1.5 or GM. Can anyone clarify where the problem lies?
Testing with 0.6.3 on 1.5 RC1 using the following (really annoying)
script, I did not observe any truncation of the href values.
What page did you observe that on? Can you provide a script that
exhibits the behavior specifically? The one you provided is trying to
do something useful, but I think I'm missing the point.
links = document.evaluate("//a[@href]", document, null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < links.snapshotLength; i++) {
a = links.snapshotItem(i);
href = a.href;
alert(href);
}
>
>
> links = document.evaluate("//a[@href]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
>
> for (var i = 0; i < links.snapshotLength; i++)
> {
> a = links.snapshotItem(i);
> href = a.href;
>
> if (href.match(/newschannel5\.com\/content\/news\//i))
> {
> href += '?print=true';
> }
>
> if (href != a.href)
> {
> a.href = href;
> a.onclick = null;
> }
> }
>
> Thank you!
>
>
>
>
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
>
More information about the Greasemonkey
mailing list