Articles

SubtleClickAll Bookmarklet

A friend of mine asked me for a simple bookmarklet today. He uses Safari so that opens up a few possibilities.

Take a CSS Selector and run the click method on each matching element.

And here it is:

SubtleClickAll

Drag that link to your bookmarks and you’re good to go.

Known to work in Safari beta 4. Has not been tested anywhere else.
Could also work in IE8 or Firefox 3.1+ or Safari 3.1+

The code is all up on gist.github.com

javascript:function%20SubtleClickAll(SELECTOR,timeout){timeout=timeout||0;var%20node,nodes=Array.prototype.slice.call(document.querySelectorAll(SELECTOR));function%20NEXT(){node=nodes.pop();if(node)setTimeout(function(){node.click();NEXT();},timeout);};NEXT();};SubtleClickAll(prompt(%22SubtleClickAll%20(Thomas%20Aylott%20subtleGradient.com)%22,%22CSS3%20Selector%22),10);
view raw SubtleClickAll.bookmarklet hosted with ❤ by GitHub
<a href="javascript:function%20SubtleClickAll(SELECTOR,timeout){timeout=timeout||0;var%20node,nodes=Array.prototype.slice.call(document.querySelectorAll(SELECTOR));function%20NEXT(){node=nodes.pop();if(node)setTimeout(function(){node.click();NEXT();},timeout);};NEXT();};SubtleClickAll(prompt(%22SubtleClickAll%20(Thomas%20Aylott%20subtleGradient.com)%22,%22CSS3%20Selector%22),10);" title="SubtleClickAll (Thomas Aylott subtleGradient.com)">SubtleClickAll</a>
<hr />
Known to work in Safari beta 4. Has not been tested anywhere else.<br />
Could also work in IE8 or Firefox 3.1+ or Safari 3.1+
view raw SubtleClickAll.bookmarklet.html hosted with ❤ by GitHub
function SubtleClickAll(SELECTOR,timeout){
timeout=timeout||0;
var node,nodes=Array.prototype.slice.call(document.querySelectorAll(SELECTOR));
function NEXT(){
node=nodes.pop();
if(node)setTimeout(function(){node.click();NEXT();},timeout);
};NEXT();
};
SubtleClickAll(prompt("SubtleClickAll (Thomas Aylott subtleGradient.com)","CSS3 Selector"),10);
view raw SubtleClickAll.js hosted with ❤ by GitHub
javascript:function%20SubtleClickAllJr(SELECTOR)%20{Array.prototype.slice.call(document.querySelectorAll(SELECTOR)).forEach(function(node)%20{node.click();});};SubtleClickAllJr(prompt(%22SubtleClickAll%20(Thomas%20Aylott%20subtleGradient.com)%22,%22CSS3%20Selector%22));
view raw SubtleClickAllJr.bookmarklet hosted with ❤ by GitHub
function SubtleClickAllJr(SELECTOR) {
Array.prototype.slice.call(document.querySelectorAll(SELECTOR)).forEach(function(node) {
node.click();
});
};
SubtleClickAllJr(prompt("SubtleClickAllJr (Thomas Aylott subtleGradient.com)","CSS3 Selector"));
view raw SubtleClickAllJr.js hosted with ❤ by GitHub

Related Articles

  • 29 Jul 2009 CSS Position Fixed for IE6
  • 23 Jul 2009 Subtle Hover CSS Inspect Bookmarklet
  • 22 Jun 2009 Replace document.write using MooTools
  • 21 Jun 2009 Testing a way to post to my blog quickly
  • 21 Jun 2009 Jekyll quick post shell script
  • 09 Apr 2009 Blazing fast Semantic JS Templating with edit-in-place templates!
  • 05 Dec 2008 MooTools databinding plugins coming soon
  • 25 Oct 2008 Tabs or Spaces?
  • 20 Oct 2008 How to have a box default to hidden and then fade it in later
  • 21 Sep 2008 NEW TextMate Code Completion and Smart ToolTips
Thomas Aylott Polaroid
SubtleGradient
  • GitHub
  • X (née Twitter)
  • LinkedIn
  • YouTube
  • OpenSea
  • Facebook
  • Blog
  • Email

Thomas Aylott / subtleGradient