Open Side Menu Go to the Top
Register
Bookmarklet to click all Spoiler tags on a page Bookmarklet to click all Spoiler tags on a page

01-07-2008 , 01:10 PM
As demonstrated by the OOT thread The Wire Episode 51 "More With Less" posters are often very good about using the spoiler tag.

But it can be a drag clicking each spoiler in a long thread like that.

So here is a bookmarklet to help you out. Selecting the bookmarklet from your bookmarks will make the browser act as if you clicked each Spoiler button on the page.

To use it, create a new bookmark. Give it a name like "2+2 Click Spoilers" and then in the location field, paste the text from the code box below.

There is a difference in browser behavior, so grab the code for your browser.

For Firefox

Code:
javascript: HTMLElement.prototype.click = function() { var evt = this.ownerDocument.createEvent('MouseEvents'); evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null); this.dispatchEvent(evt); }; pi=document.getElementsByTagName('input');for(var i=0;i<pi.length;i++){if (pi.item(i).className=='spoilerButton'){pi.item(i).click();}};
For IE and Opera

Code:
javascript: var pi=document.getElementsByTagName('input');for(var i=0;i<pi.length;i++){if (pi.item(i).className=='spoilerButton'){pi.item(i).click();}};
Bookmarklet to click all Spoiler tags on a page Quote
01-07-2008 , 02:22 PM
awesome ty stevie

Last edited by devilbiss; 01-07-2008 at 02:27 PM. Reason: tested in ff works great
Bookmarklet to click all Spoiler tags on a page Quote

      
m