There's this annoying website I use (facebook).  It has a series of
onloadRegisters calls.  I want to get rid of one of them.  I tried
this, and the alert() statements tell me it worked, but firebug shows
the end page unmodified and the code still runs.  I've decided to give
up and just ask someone.

var doc = document.getElementsByTagName('script');
for (var i = 0; i < doc.length; i++){
  if (doc[i].innerHTML.indexOf( 'MegaphoneHelper' ) > 0) {
    window.alert( "Found it!" );
//  window.alert( doc[i].innerHTML );
  doc[i].innerHTML = doc[i].innerHTML.replace( "MegaphoneHelper",
"bogus" );
//  window.alert( doc[i].innerHTML );
    if (doc[i].innerHTML.indexOf( 'MegaphoneHelper' ) > 0) {
      window.alert( 'It is still there!' );
    } else { window.alert( 'It is gone now!' ); }
  }
}

My goal here is prevent facebook from subjecting me to modal dialogs
now or ever again.

--

You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.


Reply via email to