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.
<span class="thumb" id="789">
<a href="/post/image/12345" onclick="return PostMenu.click(12345)">
<img class="preview" src="http://abc.com/image.jpg" title="title" alt="">
</a>
</span>
I believe that onclick="return PostMenu.click(12345)"
is doing this. How can I replace the PostMenu.click()
function with my own empty function in GreaseMonkey? Is there a way to make a GreaseMonkey script intercept all onclick events?
My only other option is to go through all the span
classes and remove the onclick="return PostMenu.click(12345)"
from the link tags. But since there can be over a hundred of these on a single page, I'd rather not do that.