Skip to content

Instantly share code, notes, and snippets.

@antonpetrovmain
Created October 21, 2019 10:48
Show Gist options
  • Select an option

  • Save antonpetrovmain/dcf94dc49ab11827c34bcf1b4e7e91ca to your computer and use it in GitHub Desktop.

Select an option

Save antonpetrovmain/dcf94dc49ab11827c34bcf1b4e7e91ca to your computer and use it in GitHub Desktop.
How to archive all messages from inbox?
(function run() {
let all = document.querySelectorAll('div[aria-label="Conversation actions"]');
if (all.length == 0) return;
let a = all[0];
a.click();
setTimeout(() => {
document.querySelectorAll('a[role=menuitem]').forEach(act => {
if (act.innerText.match(/Archive/)) act.click();
});
run();
}, 250);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment