Skip to content

Instantly share code, notes, and snippets.

@kouk
Created November 17, 2025 08:26
Show Gist options
  • Select an option

  • Save kouk/137f98913c7168e6096916a8c8fca8c4 to your computer and use it in GitHub Desktop.

Select an option

Save kouk/137f98913c7168e6096916a8c8fca8c4 to your computer and use it in GitHub Desktop.
manage_linkedin_conversations.js
// const timer = ms => new Promise(res => setTimeout(res, ms));
async function manage_linkedin_conversations(action, times) {
for (var i = 0; i < times; i++) {
await Promise.all([...document.querySelectorAll("label[aria-label^='Select conversation']")].map((el) => {return el.click()}));
await timer(1000);
var btn = document.querySelector('button[aria-label="' + action + '"]');
if (btn ) {
await btn.click();
await timer(1000);
} else {
break;
}
}
};
// manage_linkedin_conversations("Archive", 5);
// manage_linkedin_conversations("Restore", 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment