[Greasemonkey] FF 1.5RC1/GM 0.6.3 Issue with User Script

Randy H. Tjahjono mysubscriptions at pobox.com
Tue Nov 8 21:40:03 EST 2005


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?


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!






More information about the Greasemonkey mailing list