title: How to replace onclick event with GreaseMonkey?
body: <p>This website has a gallery of images.  Each time I click on a thumbnail image it opens the URL in a new tab (not because I set firefox to open links in new tabs).  I want to just open the URL in the same window.  An example of what the thumbnail images looks like is this.</p>
  
  <pre><code>&lt;span class="thumb" id="789"&gt;
  &lt;a href="/post/image/12345" onclick="return PostMenu.click(12345)"&gt;
  &lt;img  class="preview" src="http://abc.com/image.jpg" title="title" alt=""&gt;
  &lt;/a&gt;
  &lt;/span&gt;
  </code></pre>
  
  <p>I believe that <code>onclick="return PostMenu.click(12345)"</code> is doing this.  How can I replace the <code>PostMenu.click()</code> function with my own empty function in GreaseMonkey? Is there a way to make a GreaseMonkey script intercept all onclick events?</p>
  
  <p>My only other option is to go through all the <code>span</code> classes and remove the <code>onclick="return PostMenu.click(12345)"</code> from the link tags.  But since there can be over a hundred of these on a single page, I'd rather not do that.</p>