Skip to content

Instantly share code, notes, and snippets.

@dirad
dirad / gist:92936fc1066f48db3f4d1b6529b6d883
Created November 12, 2025 10:04
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/ma
@dirad
dirad / download even flies from DO billing
Created August 4, 2024 16:27
Digital ocean billing receipts downloader
function waitForElementAndClick(parentElement) {
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
mutation.addedNodes.forEach((node) => {
if (node.nodeName === 'div') {
node.click();
console.log(node);
observer.disconnect();
}
});