Last active
February 13, 2025 06:22
-
-
Save brgmn/f7aa1db058b87e03698b6c99a432edd5 to your computer and use it in GitHub Desktop.
Bookmarklet to trigger all meta business manager invoice pdf downloads at once
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(async()=>{function wait(ms){return new Promise(r=>setTimeout(r,ms))}function simulateClick(el){if(!el)return;el.dispatchEvent(new MouseEvent("mouseover",{bubbles:true}));el.dispatchEvent(new MouseEvent("mousedown",{bubbles:true}));el.click();el.dispatchEvent(new MouseEvent("mouseup",{bubbles:true}))}const pdfLinks=[...document.querySelectorAll('a[href*="pdf=true"]')];if(!pdfLinks.length){alert("No invoice links (pdf=true) found on this page.");return}alert("Found "+pdfLinks.length+" invoice(s). Downloading...");for(let link of pdfLinks){console.log("Triggering PDF download:",link.href);simulateClick(link);await wait(3000);}alert("All PDF downloads triggered!");})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use this at the "all transactions" page of an ad account starting with https://business.facebook.com/billing_hub/payment_activity...