Sign In/My Account | View Cart  

advertisement

AddThis Social Bookmark Button

Article:
  Avoid Common Pitfalls in Greasemonkey
Subject:   Excellent! Thanks...
Date:   2006-12-13 04:49:28
From:   PhiLho
Great article, it solved the mystery why a script I injected in the page (using an appendChild of a script element) didn't worked when moved in a standalone GM script.
I was annoyed to see I couldn't set properties to a created element: I add a button to act on a div, so I wrote: button.targetDiv = d; to keep a reference to the div element to act upon.
I can't use the setAttribute trick, as I believe it is limited to textual attributes.
But I can use button.wrappedJSObject.targetDiv = d; which should be relatively safe (no sensible info here!)