For whatever reason, I had no luck attaching a <div> to the body. However, I didn't need to figure that out because I figured out the *real* cause of my problem: iframes. The script was triggering on each iframe.
I fixed that with belt and suspenders: First, I tweaked the "include" statement to match only the main URL, and not any of the iframe URLs. Because I'm not 100% sure that'll always work perfectly, I also added a check inside the script for body#main, which is only used for the main page. Seems to work properly now. At some point I'll need to mess around further and see why I wasn't able to add the div as suggested, but for now I'll settle for a working script. Thanks, Neil On Wed, May 30, 2012 at 11:48 AM, Sam Larison <[email protected]> wrote: > Is this script running at document-start? Probably the easiest way to > detect if it has run previously is attach a div with a unique ID to > document.body > > > On Wed, May 30, 2012 at 10:15 AM, Neil Weinstock <[email protected] > > wrote: > >> This doesn't work at all. As each script is triggered, the variable >> unsafeWindow.monkeyRunning *always* starts out undefined. Which probably >> means I did something wrong here, but I'm not sure what else I should be >> doing. >> > > -- > 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. > -- 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.
