*** PREVIEW PREVIEW PREVIEW ***
" + "DO NOT SHARE
*** PREVIEW PREVIEW PREVIEW ***") if (!document.querySelector("body").classList.contains("post-template")) return; let trigger = document.createElement("div"); let footnotes = document.querySelector(".footnotes"); if (footnotes) { footnotes.before(trigger); } else { document.querySelector(".post-content").after(trigger); } new IntersectionObserver((entries, observer) => { entries.forEach(entry => { if (!entry.isIntersecting) return; observer.disconnect(); plausible("Finished"); }) }).observe(trigger); new IntersectionObserver((entries, observer) => { entries.forEach(entry => { if (entry.isIntersecting) return; observer.disconnect(); plausible("Scrolled"); }) }).observe(document.querySelector(".post-title")); document.querySelectorAll('a[href="https://abyssdomain.expert/@filippo"]').forEach((link) => { link.addEventListener("click", (event) => { let opts = {} if (!event.ctrlKey && !event.metaKey && !event.shiftKey) { opts.callback = () => { event.target.click(); }; event.preventDefault(); } plausible("Mastodon profile click", opts); }, { once: true }); }); document.querySelectorAll('a[href="#/portal/signup"]').forEach((link) => { link.addEventListener("click", (event) => { plausible("Subscribe link click"); }, { once: true }); }); document.querySelectorAll('.subscribe-cta button').forEach((link) => { link.addEventListener("click", (event) => { plausible("Subscribe button click"); }, { once: true }); }); /* const observer = new MutationObserver(function() { console.log("Observed mutation"); document.querySelectorAll(".gh-portal-triggerbtn-iframe").forEach((iframe) => { console.log("Found iframe"); console.log(iframe.contentWindow.document); iframe.contentWindow.document.addEventListener("DOMContentLoaded", (event) => { console.log(iframe.contentWindow.document.querySelectorAll('.gh-portal-triggerbtn-container')); iframe.contentWindow.document.querySelectorAll('.gh-portal-triggerbtn-container').forEach((link) => { link.addEventListener("click", (event) => { console.log("Subscribe button click"); plausible("Subscribe button click"); }, { once: true }); }); }); observer.disconnect(); }); }); observer.observe(document.querySelector('body'), { childList: true, subtree: true }); */ });

Filippo Valsorda