Skip to content

Instantly share code, notes, and snippets.

@aseemk
Last active February 14, 2018 16:41
Show Gist options
  • Save aseemk/5000668 to your computer and use it in GitHub Desktop.
Save aseemk/5000668 to your computer and use it in GitHub Desktop.
A bookmarklet for "selecting all" (technically, "toggling all") checkboxes on the Amazon AWS S3 console.

For use on:

https://console.aws.amazon.com/s3/home

Only tested in Chrome.

Installation instructions:

  1. View > Always Show Bookmarks Bar.

  2. Right-click bookmarks bar > Add Page...

  3. Paste contents of bookmarklet.js below into the URL field.

  4. Give it any name, like "S3 check all".

Hit save, and voila! You can now select/toggle all checkboxes on the S3 console.

This code is released into the public domain. Enjoy!

Aseem Kishore of FiftyThree

javascript:(function () {
document.domain = 'console.aws.amazon.com';
var spans = document.querySelector('iframe').contentDocument.querySelectorAll('tr.list-view-item[type] span.inner');
[].slice.call(spans).forEach(function (span) {
span.click();
});
})();
// The actual console is in an iframe from a different origin.
// Fortunately, they share the same TLD, and the iframe sets document.domain,
// so we're able to set ours to the same value. (And we need to.)
document.domain = 'console.aws.amazon.com';
// Grab all checkboxes...
var spans = document.querySelector('iframe').contentDocument.querySelectorAll('tr.list-view-item[type] span.inner');
// ...and click them all:
[].slice.call(spans).forEach(function (span) {
span.click();
});
@cpursley
Copy link

cpursley commented Aug 8, 2015

👍

@richfab
Copy link

richfab commented Aug 12, 2015

Really helped me!

@dArignac
Copy link

Made my day - thanks!

@alfondotnet
Copy link

Thank you for this!

@stevesohcot
Copy link

thanks!!!

@bsgrd
Copy link

bsgrd commented Jan 12, 2017

Awesome, thanks!

@mbobak
Copy link

mbobak commented Feb 6, 2017

Hmm...not working for me...on Chrome on Windows....seems to only select a small subset of total files in a folder.

@d3ming
Copy link

d3ming commented Feb 8, 2017

woah hey there @aseemk =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment