DEV Community

Bruce Axtens
Bruce Axtens

Posted on

3 1

The Delight of Browser DevTools

I was on the Moz.com site, in their notifications panel (which you can't get to without a login and I'm not giving you mine!)

There I had over 800 CSV reports waiting which had been automatically generated back in June. They all needed to be archived. And the only way you can do that is click the "Messages" checkbox until a slab of 25 are selected, and then hit the "Archive" button.

The thought of doing that 32 times didn't appeal. Neither did scripting with Selenium. So I hit upon the idea of using the browser's devtools window, in this case Chrome's.

I right clicked the "Messages" checkbox, inspected the element, and worked out a simple CSS path.

var cb = document.querySelectorAll("th input[type=checkbox]")[0];
Enter fullscreen mode Exit fullscreen mode

I did the same with the "Archive" button.

var ar = document.querySelectorAll('button[test-action="archive"]')[0];
Enter fullscreen mode Exit fullscreen mode

I noticed that I had to click the checkbox twice, finally ending up with the following:

cb.click();cb.click();ar.click()
Enter fullscreen mode Exit fullscreen mode

With that in the console, it was a lot simpler and faster to simply up-arrow and press enter until all the messages had been archived.

Ah, the joys of browser devtools!

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay