// ==UserScript== // @name Frontend Redirect — FMHY Privacy Frontends (large) // @namespace muse.frontend-redirect // @version 1.5.0 // @updateURL https://raw.githubusercontent.com/your1fry1malce/frontend-redirect/main/frontend-redirect.user.js // @downloadURL https://raw.githubusercontent.com/your1fry1malce/frontend-redirect/main/frontend-redirect.user.js // @description Redirects supported websites to alternative frontends, with broad default coverage, manual instance selection, bypass, and original-link controls. // @match *://*/* // @run-at document-start // @noframes // @grant GM_getValue // @grant GM_setValue // @grant GM_registerMenuCommand // @license MIT // ==/UserScript== (function () { 'use strict'; /* Default rules. Instances are directory-listed and not live-verified. * Rules without a valid instance stay enabled but inert until one is * configured. YouTube, YouTube Music and WolframAlpha are opt-in (off * by default). */ const RULES = [ // key, on, instance, hosts, skipPrefixes, transform ['reddit', true, 'safereddit.com', ['reddit.com','www.reddit.com','new.reddit.com','old.reddit.com','np.reddit.com','m.reddit.com'], ['/login','/register','/account','/settings','/submit','/message','/chat','/mod','/premium','/api']], ['youtube', false, 'piped.private.coffee', ['youtube.com','www.youtube.com','m.youtube.com'], ['/signin','/login','/account','/upload','/create','/feed/subscriptions','/feed/history','/feed/library','/paid_memberships','/purchase','/verify_age'], 'yt'], ['instagram', true, 'kittygram.irelephant.net', ['instagram.com','www.instagram.com'], ['/accounts','/direct','/create','/challenge','/oauth','/settings','/stories','/age_verification']], ['tiktok', true, 'urlebird.com', ['tiktok.com','www.tiktok.com','m.tiktok.com'], ['/login','/signup','/upload','/settings','/messages','/creator-center','/studio','/account','/age-verification'], 'ttviewer'], ['twitch', true, 'safetwitch.privacyredirect.com', ['twitch.tv','www.twitch.tv','m.twitch.tv'], ['/login','/signup','/settings','/subscriptions','/wallet','/inventory','/drops','/dashboard','/moderator','/checkout']], ['tumblr', true, 'tumblr.nerdvpn.de', ['tumblr.com','www.tumblr.com'], ['/login','/register','/settings','/dashboard','/new','/edit','/inbox','/messages','/reblog','/account']], ['tumblrblog', true, 'tumblr.nerdvpn.de', ['*.tumblr.com'], ['/login','/register','/settings','/dashboard','/new','/edit','/inbox','/messages','/reblog','/account'], 'tumblrblog'], ['medium', true, 'scribe.privacyredirect.com', ['medium.com','www.medium.com'], ['/m/signin','/m/signout','/new-story','/me','/settings','/membership','/plans']], ['mediumblog', true, 'scribe.privacyredirect.com', ['*.medium.com'], ['/m/signin','/m/signout','/new-story','/me','/settings'], 'mediumblog'], ['quora', true, 'quetre.iket.me', ['quora.com','www.quora.com','*.quora.com'], ['/login','/signup','/settings','/messages','/notifications','/answer','/add_question','/account']], ['imgur', true, 'rimgo.manerakai.com', ['imgur.com','www.imgur.com','m.imgur.com','i.imgur.com'], ['/signin','/register','/upload','/new','/account','/settings']], ['stackoverflow', true, 'overflow.ducks.party', ['stackoverflow.com','www.stackoverflow.com'], ['/users/login','/users/signup','/users/logout','/users/edit','/questions/ask','/review','/account','/oauth']], ['stackexchange', true, 'overflow.ducks.party', ['*.stackexchange.com','superuser.com','serverfault.com','askubuntu.com','mathoverflow.net','www.superuser.com','www.serverfault.com','www.askubuntu.com','www.mathoverflow.net'], ['/users/login','/users/signup','/users/logout','/users/edit','/questions/ask','/review','/account','/oauth'], 'exchange'], ['genius', true, 'dumb.canine.tools', ['genius.com','www.genius.com'], ['/login','/signup','/sessions','/settings','/songs/new','/annotations','/account']], ['goodreads', true, 'biblioreads.vercel.app', ['goodreads.com','www.goodreads.com'], ['/user/sign_in','/user/sign_up','/user/edit','/review/edit','/review/new','/review/list','/settings','/messages','/shelf/edit']], ['imdb', true, 'libremdb.ducks.party', ['imdb.com','www.imdb.com','m.imdb.com'], ['/registration','/ap/signin','/signin','/account','/user','/list/create','/settings']], ['reuters', true, 'neuters.de', ['reuters.com','www.reuters.com'], ['/account','/login','/register','/my-account','/subscription','/checkout','/pf','/arc']], ['fandom', true, 'breezewiki.com', ['*.fandom.com','*.wikia.com'], ['/login','/register','/f'], 'fandom'], ['urbandict', true, 'rd.bloat.cat', ['urbandictionary.com','www.urbandictionary.com'], ['/add.php','/login','/signup','/account','/settings','/vote.php']], ['bandcamp', true, 'tent.sny.sh', ['bandcamp.com','www.bandcamp.com'], ['/login','/signup','/settings','/checkout','/cart','/purchase','/download','/edit','/upload','/merch'], 'tentsearch'], ['bandcampband', true, 'tent.sny.sh', ['*.bandcamp.com'], ['/login','/signup','/settings','/checkout','/cart','/purchase','/download','/edit','/upload','/merch'], 'tent'], ['pixiv', true, 'pixivfe.exozy.me', ['pixiv.net','www.pixiv.net'], ['/login','/signup','/settings','/upload','/bookmark_add.php','/messages','/manage','/account']], ['bilibili', true, 'mikuinv.apicalshark.dedyn.io', ['bilibili.com','www.bilibili.com'], ['/login','/register','/account','/upload','/platform','/member','/messages','/settings']], ['bilibilispace', true, 'mikuinv.apicalshark.dedyn.io', ['space.bilibili.com'], ['/login','/register','/account','/upload','/settings'], 'bspace'], ['soundcloud', true, 'soundcloak.tijn.dev', ['soundcloud.com','www.soundcloud.com','m.soundcloud.com'], ['/signin','/signup','/upload','/settings','/messages','/you','/stream','/feed','/checkout','/oauth']], ['wolfram', false, '', ['wolframalpha.com','www.wolframalpha.com'], ['/login','/signup','/account','/settings','/pro','/subscription','/checkout']], // WolfreeAlpha: instance UNKNOWN ['ytmusic', false, '', ['music.youtube.com'], ['/login','/signin','/account','/upload','/library','/premium','/settings']], ['deviantart', true, 'skunky.bloat.cat', ['deviantart.com','www.deviantart.com'], ['/users/login','/join','/settings','/submit','/notifications','/chat']], ['instructables', true, '', ['instructables.com','www.instructables.com'], ['/account','/login','/signup','/editInstructable','/create','/upload','/settings','/you']], ['coub', true, 'koub.bloat.cat', ['coub.com','www.coub.com'], ['/login','/signup','/create','/upload','/settings','/account']], ['ultguitar', true, 'freetar.de', ['ultimate-guitar.com','www.ultimate-guitar.com','tabs.ultimate-guitar.com'], ['/login','/register','/account','/settings','/submit','/pro','/checkout','/messages']], ].map(function (r) { return { key: r[0], enabled: r[1], instance: r[2], hosts: r[3], skip: r[4] || [], transform: r[5] || null }; }); const SETTINGS_KEY = 'frontendRedirectSettingsV2'; const LEGACY_KEY = 'frontendRedirectSettings'; const BLOCKED_HOSTS = new Set([ 'safetwitch.adminforge.de', 'overflow.adminforge.de', 'quetre.private.coffee', 'structables.private.coffee', 'music.adminforge.de' ]); // Directory-listed candidates only; these are not guaranteed working. const INSTANCE_CHOICES = { reddit: ['safereddit.com', 'redlib.privacyredirect.com', 'redlib.catsarch.com', 'red.artemislena.eu'], instagram: ['kittygram.irelephant.net', 'kittygr.am', 'kittygram.nexussfan.cz', 'kittygram.kareem.one', 'kg.lus.lu', 'kg.meowing.de', 'kittygram.nadeko.net', 'gram.utilibre.org'], twitch: ['safetwitch.privacyredirect.com', 'safetwitch.canine.tools', 'safetwitch.ducks.party'], quora: ['quetre.iket.me', 'quora.nerdvpn.de', 'quetre.privacyredirect.com'], stackoverflow: ['anonymousoverflow.privacyredirect.com', 'overflow.ducks.party'], stackexchange: ['anonymousoverflow.privacyredirect.com', 'overflow.ducks.party'], tumblr: ['priviblur.ducks.party'], tumblrblog: ['priviblur.ducks.party'] }; function readRaw(key, fallback) { try { return typeof GM_getValue === 'function' ? GM_getValue(key, fallback) : fallback; } catch (e) { return fallback; } } function validHost(input) { if (typeof input !== 'string') { return false; } const host = input.toLowerCase(); if (host.length > 253 || !/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z][a-z0-9-]*[a-z0-9]$/.test(host)) { return false; } return !BLOCKED_HOSTS.has(host) && !RULES.some(r => hostMatches(r.hosts, host)) && !['youtu.be', 'redd.it'].includes(host); } function saveSettings(settings) { try { if (typeof GM_setValue !== 'function') { return false; } GM_setValue(SETTINGS_KEY, settings); return true; } catch (e) { return false; } } function readSettings() { const v2 = readRaw(SETTINGS_KEY, null); if (v2 && typeof v2 === 'object' && !Array.isArray(v2)) { return v2; } // Preserve explicit opt-outs and valid custom hosts, but do not silently // reactivate an uncertain/retired default. Leave the old key untouched. const legacy = readRaw(LEGACY_KEY, {}) || {}; const migrated = {}; for (const rule of RULES) { const old = legacy[rule.key]; if (!old || typeof old !== 'object') { continue; } const next = {}; if (old.enabled === false) { next.enabled = false; } if (old.instance === '') { next.instance = ''; next.enabled = false; } else if (validHost(old.instance) && old.instance !== rule.instance) { next.instance = old.instance.toLowerCase(); next.enabled = false; } if (Object.keys(next).length) { migrated[rule.key] = next; } } saveSettings(migrated); return migrated; } const savedSettings = readSettings(); // One-time restore (v1.5.0): re-enable the default services once, // keeping valid custom instance choices and clearing blank or retired // overrides. Manual opt-outs made after the restore are respected. const RESTORE_KEY = 'frontendRedirectRestoreV150'; if (readRaw(RESTORE_KEY, false) !== true) { for (const rule of RULES) { if (!rule.enabled) { continue; } const saved = savedSettings[rule.key]; if (!saved || typeof saved !== 'object') { continue; } delete saved.enabled; if (!validHost(saved.instance)) { delete saved.instance; } if (!Object.keys(saved).length) { delete savedSettings[rule.key]; } } if (saveSettings(savedSettings)) { try { GM_setValue(RESTORE_KEY, true); } catch (e) { /* storage unavailable */ } } } RULES.forEach(function (rule) { const saved = savedSettings[rule.key]; if (!saved) { return; } if (typeof saved.enabled === 'boolean') { rule.enabled = saved.enabled; } if (saved.instance === '' || validHost(saved.instance)) { rule.instance = saved.instance.toLowerCase(); } }); function hasBypass(url) { return url.searchParams.getAll('front').includes('off') || /(?:^|[&#])front=off(?:&|$)/.test(url.hash); } function originalBypass(href) { const url = new URL(href); url.searchParams.set('front', 'off'); return url.href; } // Params a transform already translated into its own form; preserving // them too would duplicate them (Bandcamp's q= becomes Tent's query=). const CONSUMED_PARAMS = { tentsearch: ['q'] }; function preserveOriginalParts(target, source, skipKeys) { const out = new URL(target); const existing = new Set(out.searchParams.keys()); source.searchParams.forEach(function (value, key) { if (skipKeys && skipKeys.indexOf(key) !== -1) { return; } if (!existing.has(key)) { out.searchParams.append(key, value); } }); if (source.hash && !out.hash) { out.hash = source.hash; } return out.href; } function hostMatches(patterns, hostname) { return patterns.some(function (p) { if (p.indexOf('*.') === 0) { const suffix = p.slice(1); // '.example.com' return hostname.length > suffix.length && hostname.slice(-suffix.length) === suffix; } return hostname === p; }); } function ruleFor(hostname) { for (const rule of RULES) { // First matching rule wins even when disabled (prevents wildcard takeover). if (hostMatches(rule.hosts, hostname)) {return rule.enabled && validHost(rule.instance) ? rule : null;} } return null; } function isSkipped(rule, url) { if (hasBypass(url)) {return true;} // Never forward credentials, authentication callbacks, or explicit age checks. if (url.username || url.password || /(?:^|[?#&])(?:access_token|refresh_token|id_token|token|authorization|password|sessionid|oauth_token)=/i.test(url.hash) || Array.from(url.searchParams.keys()).some(k => /^(?:access_token|refresh_token|id_token|token|auth|authorization|code|password|session|sessionid|oauth_token)$/i.test(k))) { return true; } let path; try { path = decodeURIComponent(url.pathname).toLowerCase(); } catch (e) { return true; } if (/(?:^|\/)(?:age[-_]?verification|verify[-_]?age|age[-_]?gate|age[-_]?restricted|adult|r-?18|nsfw|mature|oauth|sso|login|signin|sign-in|logout|signup|register|checkout)(?:\/|$)/i.test(path)) { return true; } return rule.skip.some(function (prefix) { const p = prefix.toLowerCase(); return path === p || path.indexOf(p + '/') === 0; }); } function base(rule, url) { // same-path copy onto the instance host const out = new URL(url.href); out.protocol = 'https:'; out.hostname = rule.instance; out.port = ''; return out.href; } const TRANSFORMS = { yt: function (rule, url) { const m = url.pathname.match(/^\/(shorts|live)\/([\w-]{6,})/); if (m) {return 'https://' + rule.instance + '/watch?v=' + m[2];} return base(rule, url); }, ttviewer: function (rule, url) { // Urlebird supports public profile pages; keep video links on TikTok. const m = url.pathname.match(/^\/@([A-Za-z0-9._-]+)\/?$/); if (!m) { return null; } return 'https://' + rule.instance + '/user/' + encodeURIComponent(m[1]) + '/'; }, tumblrblog: function (rule, url) { // BLOG.tumblr.com/post/ID/SLUG -> /BLOG/ID/SLUG const blog = url.hostname.split('.')[0]; const m = url.pathname.match(/^\/post\/(\d+)(\/.*)?$/); if (m) {return 'https://' + rule.instance + '/' + blog + '/' + m[1] + (m[2] || '');} return 'https://' + rule.instance + '/' + blog + url.pathname + url.search; }, mediumblog: function (rule, url) { // Scribe accepts article IDs; publications are not necessarily usernames. const id = url.pathname.match(/(?:^|[-/])([a-f0-9]{12})\/?$/i); return id ? 'https://' + rule.instance + '/p/' + id[1] : null; }, exchange: function (rule, url) { // Use the full site hostname for AnonymousOverflow's exchange route. const site = url.hostname.replace(/^www\./, ''); return 'https://' + rule.instance + '/exchange/' + site + url.pathname + url.search; }, fandom: function (rule, url) { // WIKI.fandom.com/wiki/PAGE -> /WIKI/wiki/PAGE const wiki = url.hostname.split('.')[0]; return 'https://' + rule.instance + '/' + wiki + url.pathname + url.search; }, tentsearch: function (rule, url) { // bandcamp.com/search?q=X -> /search.php?query=X const q = url.searchParams.get('q'); if (url.pathname === '/search' && q) {return 'https://' + rule.instance + '/search.php?query=' + encodeURIComponent(q);} return null; // bandcamp.com itself has no Tent equivalent; artist pages are *.bandcamp.com }, tent: function (rule, url) { // ARTIST.bandcamp.com/album|track/SLUG -> /release.php?artist=&type=&name= const artist = url.hostname.split('.')[0]; const m = url.pathname.match(/^\/(album|track)\/([\w-]+)\/?$/); if (m) {return 'https://' + rule.instance + '/release.php?artist=' + encodeURIComponent(artist) + '&type=' + m[1] + '&name=' + encodeURIComponent(m[2]);} if (url.pathname === '/' || url.pathname === '') {return 'https://' + rule.instance + '/artist.php?name=' + artist;} return null; }, bspace: function (rule, url) { // space.bilibili.com/ID -> /space/ID return 'https://' + rule.instance + '/space' + url.pathname + url.search; }, }; function frontendUrl(rawUrl, currentHost) { let url; try { url = new URL(rawUrl); } catch (e) { return null; } if (url.protocol !== 'http:' && url.protocol !== 'https:') {return null;} // Check before special short-link handling so ?front=off works everywhere. if (hasBypass(url) || isSkipped({skip: []}, url)) { return null; } if (url.hostname === 'youtu.be') { // short YouTube links follow the youtube rule const yt = RULES.find(function (r) { return r.key === 'youtube'; }); if (!yt.enabled || !validHost(yt.instance)) {return null;} const id = url.pathname.slice(1); if (!/^[A-Za-z0-9_-]{11}$/.test(id)) {return null;} const out = new URL('https://' + yt.instance + '/watch'); out.searchParams.set('v', id); return preserveOriginalParts(out.href, url); } if (url.hostname === 'redd.it') { // short Reddit links follow the reddit rule const rd = RULES.find(function (r) { return r.key === 'reddit'; }); if (!rd.enabled || !validHost(rd.instance)) {return null;} const id = url.pathname.slice(1); return /^[a-z0-9]+$/i.test(id) ? preserveOriginalParts('https://' + rd.instance + '/comments/' + id, url) : null; } const rule = ruleFor(url.hostname); if (!rule) {return null;} if (currentHost && hostMatches(rule.hosts, currentHost)) {return null;} // already on that site if (isSkipped(rule, url)) {return null;} if (rule.key === 'tumblrblog' && /^(?:www|assets|static|media|api|at|help|support|staff|login|\d+\.media)\./i.test(url.hostname)) { return null; } if (rule.key === 'mediumblog' && /^(?:www|help|support|api|cdn|static|policy)\./i.test(url.hostname)) { return null; } if (rule.key === 'quora' && !['quora.com','www.quora.com'].includes(url.hostname)) { return null; } if (rule.key === 'fandom' && !/^\/wiki\//.test(url.pathname)) { return null; } if (rule.key === 'instagram' && !/^\/(?:[\w.]+|p\/[\w-]+|reel\/[\w-]+)\/?$/.test(url.pathname)) { return null; } if (rule.transform && TRANSFORMS[rule.transform]) { const transformed = TRANSFORMS[rule.transform](rule, url); return transformed ? preserveOriginalParts(transformed, url, CONSUMED_PARAMS[rule.transform]) : null; } return base(rule, url); } /* ---- Link rewriting and original-link controls ---- */ const rewritten = new WeakMap(); const hint = 'Alt-click to open the original; Shift+Alt+C to copy it.'; function rewriteLink(a) { if (!a || !a.matches || !a.matches('a[href]')) { return; } const href = a.getAttribute('href'); const previous = rewritten.get(a); if (previous && href === previous.target) { return; } if (previous) { rewritten.delete(a); } if (!href || a.hasAttribute('download') || href.startsWith('#')) { return; } let original; try { original = new URL(href, a.baseURI || document.baseURI).href; } catch (e) { return; } const target = frontendUrl(original, location.hostname); if (!target || target === original) { return; } rewritten.set(a, { href: original, target }); a.setAttribute('href', target); const title = a.getAttribute('title') || ''; if (!title.includes(hint)) { a.setAttribute('title', title ? title + ' ' + hint : hint); } } function originalLinkFromTarget(target) { const anchor = target && target.closest ? target.closest('a[href]') : null; const state = anchor && rewritten.get(anchor); return state && anchor.getAttribute('href') === state.target ? { anchor, href: state.href } : null; } function installLinkControls() { document.addEventListener('click', function (event) { if (!event.altKey || event.button !== 0) { return; } const original = originalLinkFromTarget(event.target); if (!original) { return; } event.preventDefault(); event.stopImmediatePropagation(); const href = originalBypass(original.href); if (original.anchor.target === '_blank' || event.ctrlKey || event.metaKey) { window.open(href, '_blank', 'noopener,noreferrer'); } else { location.assign(href); } }, true); document.addEventListener('keydown', function (event) { if (!(event.shiftKey && event.altKey && event.key.toLowerCase() === 'c')) { return; } const original = originalLinkFromTarget(document.activeElement); if (!original || !navigator.clipboard) { return; } event.preventDefault(); navigator.clipboard.writeText(original.href).catch(function () {}); }); } function configureService() { const menu = RULES.map(function (rule, index) { return (index + 1) + '. ' + rule.key + ' (' + (rule.enabled ? (validHost(rule.instance) ? 'on' : 'on, awaiting instance') : 'off') + '; ' + (rule.instance || 'no instance') + ')'; }).join('\n'); const selection = prompt('Choose a service number to configure:\n' + menu); if (selection === null) { return; } const index = Number(selection) - 1; if (!Number.isInteger(index) || index < 0 || index >= RULES.length) { return; } const rule = RULES[index]; const action = prompt('For ' + rule.key + ', enter: on, off, instance, fallback, or reset', 'on'); if (action === null) { return; } const settings = readSettings(); const current = Object.assign({}, settings[rule.key] || {}); const command = action.trim().toLowerCase(); if (command === 'on' || command === 'off') { if (command === 'on' && !validHost(rule.instance)) { alert('Set a valid instance hostname first.'); return; } current.enabled = command === 'on'; } else if (command === 'fallback') { const choices = (INSTANCE_CHOICES[rule.key] || []).filter(validHost); if (!choices.length) { alert('No preset fallback choices are listed for this service.'); return; } const choiceMenu = choices.map(function (host, choiceIndex) { return (choiceIndex + 1) + '. ' + host + (host === rule.instance ? ' (current)' : ''); }).join('\n'); const choice = prompt('Choose an instance for ' + rule.key + ' (listed, NOT live-verified):\n' + choiceMenu); if (choice === null) { return; } const choiceIndex = Number(choice) - 1; if (!Number.isInteger(choiceIndex) || choiceIndex < 0 || choiceIndex >= choices.length) { return; } current.instance = choices[choiceIndex]; } else if (command === 'instance') { const input = prompt('Enter an instance hostname (for example, example.net). Leave blank to disable this instance.', rule.instance || ''); if (input === null) { return; } const host = input.trim(); if (host) { if (!validHost(host)) { alert('Use a valid hostname, not an original service or a known retired host.'); return; } current.instance = host.toLowerCase(); } else { current.instance = ''; current.enabled = false; } } else if (command === 'reset') { delete settings[rule.key]; if (!saveSettings(settings)) { alert('Unable to save settings.'); return; } location.reload(); return; } else { return; } settings[rule.key] = current; if (!saveSettings(settings)) { alert('Unable to save settings.'); return; } location.reload(); } if (typeof GM_registerMenuCommand === 'function') { GM_registerMenuCommand('Frontend Redirect: Configure services', configureService); GM_registerMenuCommand('Frontend Redirect: Reset all defaults', function () { if (confirm('Reset all service settings to v1.5.0 defaults?')) { if (saveSettings({})) { location.reload(); } else { alert('Unable to save settings.'); } } }); } function rewriteAll(root) { if (root.nodeType === 1 && root.matches('a[href]')) { rewriteLink(root); } if (root.querySelectorAll) { root.querySelectorAll('a[href]').forEach(rewriteLink); } } function startObserver() { rewriteAll(document); new MutationObserver(function (mutations) { for (const m of mutations) { if (m.type === 'attributes') { rewriteLink(m.target); continue; } for (const node of m.addedNodes) { if (node.nodeType === 1) { rewriteAll(node); } } } }).observe(document.documentElement, { childList: true, subtree: true, attributes: true, attributeFilter: ['href'] }); } // Prevent immediate round trips to a frontend that redirects back to its source. // sessionStorage is per origin/tab; it is not a cross-site browsing log. function canLand(target) { try { if (document.referrer && new URL(document.referrer).hostname === new URL(target).hostname) { return false; } } catch (e) { /* optional referrer */ } try { const key = 'frontendRedirect:lastLanding'; const last = JSON.parse(sessionStorage.getItem(key) || 'null'); if (last && last.target === target && Date.now() - last.time < 15000) { return false; } sessionStorage.setItem(key, JSON.stringify({ target, time: Date.now() })); } catch (e) { /* storage may be unavailable */ } return true; } const target = frontendUrl(location.href, null); if (target && target !== location.href && canLand(target)) { location.replace(target); return; } installLinkControls(); if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', startObserver, { once: true }); } else { startObserver(); } })();