[Greasemonkey] Choosing the right script

Eric Darchis edarchis at gmail.com
Tue Apr 19 19:45:21 EDT 2005


Hi,

I was having a look at the user script request about mess.be. To solve the 
problem, I think the user script should prevent a specific <script> tag from 
running. But I can't figure out how to choose the right <script>.

If you open a sub-page of mess.be in another tab/window, a javascript 
detects that there is no frame anymore and forwards you back to the 
homepage.

The script looks like:
<SCRIPT LANGUAGE="JavaScript">
<!--
if (top.frames.length == 0) {
document.cookie = "newURL=" + escape(document.URL) + "; path=/;"
ver = parseInt(navigator.appVersion, 10);
if ( ((navigator.appName == "Netscape") && (ver >= 3)) ||
((navigator.appName == "Microsoft Internet Explorer") && (ver >= 4)) )
location.replace("http://www.mess.be");
else
location = "http://www.mess.be";
};
//-->
</SCRIPT>

I can't just remove the first script tag in case another one came before it. 
And innerHTML only returns the comments (here, just <!--//-->).
Any idea on how I can query on the javascript code itself ?

Thanks for your ideas,
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/greasemonkey/attachments/20050419/cbcfdff8/attachment.htm


More information about the Greasemonkey mailing list