Accepting all invites on LinkedIn

I'm a full-stack developer from South Africa 🇿🇦. I love writing about JavaScript, HTML and CSS.
Search for a command to run...

I'm a full-stack developer from South Africa 🇿🇦. I love writing about JavaScript, HTML and CSS.
Awesome! Nice to see people using it!
wow😍. That's nice but please add a call to setTimeout with 300+ milliseconds before clicking the button otherwise LinkedIn will think you're running an automated tool and will block your account.
const buttons = document.querySelectorAll('button.artdeco-button--secondary');
buttons.forEach((button) => setTimeout(() => button.click(), 1000));
Most of you know me for my consistency, a golden arrow in my blog series. I've written 1000 articles in 1008 days! Almost an article a day, and my honeymoon was the only holiday I ever took. I'm super proud of this achievement; it has been a fantasti...

It's not the first time I'll be talking about community. I think it's an essential aspect of any successful tool. This shows in my previous explorations of Astro, Medusa, and now Vendure as well. All these products thrive in a super open, welcoming, ...

The cool part about Vendure is how easy it is to set up and how abstract each layer is. Basically, we get the following elements: External database Server Worker Admin UI Frontend While this is amazing, it also brings a bit of complexity when it co...

The previous article looked at customizing Vendure on a data and process level. In this article, we'll look at customizing emails, as they are often a big part of a webshop system. We'll be looking at two different layers of customization for customi...

Even though Vendure is a pretty significant project out of the box, in some cases, we might want to go in and modify some elements to work to our specific use case. In this article, I'll take a high-level look at some elements we can customize within...

Suppose you're anything like me and get many invites after posting your LinkedIn handle on Twitter. In that case, you might be wondering if there's not a simple way to accept all of them at once.
LinkedIn used to have the option itself, but for whatever reason, it no longer does.
Luckily we as developers can leverage the power of JavaScript!
TL;DR:
// Open invite page on LinkedIn and paste this in your debug console
const buttons = document.querySelectorAll('button.artdeco-button--secondary');
buttons.forEach(button => button.click());
First, we need to go to the LinkedIn website and see there are multiple open invites.

The next step is to find out what makes an invite button unique, so we will be using the inspector to find this out.
Cmd + Shift + CCtrl + Shift + C
Here you can see both buttons, the top one being the button to decline an invitation and the bottom one to accept.
The top one has a unique class of button.artdeco-button--tertiary.
The bottom one button.artdeco-button--secondary.
With those two selectors, we can either accept or decline all invites at once!
Let's write a selector to get all the accept buttons.
const buttons = document.querySelectorAll('button.artdeco-button--secondary');
Then we can simply loop over the results and click them. Making the full function we need to execute in our console tab:
const buttons = document.querySelectorAll('button.artdeco-button--secondary');
buttons.forEach(button => button.click());
And that's it, a super simple way to accept all invites on LinkedIn at once!

Feel free to add me on LinkedIn as well.
Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter