Skip to content

Instantly share code, notes, and snippets.

@dirad
Created November 12, 2025 10:04
Show Gist options
  • Select an option

  • Save dirad/92936fc1066f48db3f4d1b6529b6d883 to your computer and use it in GitHub Desktop.

Select an option

Save dirad/92936fc1066f48db3f4d1b6529b6d883 to your computer and use it in GitHub Desktop.
gmail pop3 refresher
javascript: (function () { const gmailWindow = window; if(gmailWindow.location.href.indexOf("https://mail.google.com/") === -1){ alert('You have to run the bookmarklet from a Gmail window'); console.log('not gmail window'); return; } gmailWindow.location.assign('https://mail.google.com/mail/u/0/#settings/accounts'); const xpath = "//span[text()='Check mail now']"; const refreshAccounts = () => { const selectedNodeElements = gmailWindow.document.evaluate(xpath, gmailWindow.document, null, XPathResult.ANY_TYPE, null); let currentNode = selectedNodeElements.iterateNext(); if (currentNode === null) { setTimeout(refreshAccounts, 100); } else { while (currentNode) { currentNode.click(); console.log(currentNode); currentNode = selectedNodeElements.iterateNext(); }; /* gmailWindow.location.assign('https://mail.google.com/mail/u/0/#inbox'); */ window.scroll(0,1000); }; }; setTimeout(refreshAccounts, 100); })();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment