diff --git a/Makefile b/Makefile index a9b0abd..91319f4 100644 --- a/Makefile +++ b/Makefile @@ -76,7 +76,7 @@ prod: $(DIST) dev: $(VENV)/bin/activate $(SRC)/_static/images/favicon.png $(svgFiles) . $(VENV)/bin/activate; \ - sphinx-autobuild -a $(SRC) $(DIST) --port=0 --open-browser + sphinx-autobuild -a $(SRC) $(DIST) --host 0.0.0.0 --port=0 --open-browser dev-images: while inotifywait -e close_write,create $(IMAGES) $(IMAGES)/*.tex;do \ diff --git a/src/_static/oxide.js b/src/_static/oxide.js index 88aef9f..08d7e55 100644 --- a/src/_static/oxide.js +++ b/src/_static/oxide.js @@ -4,7 +4,7 @@ var dnt = (navigator.doNotTrack && (navigator.doNotTrack === "yes" || navigator.doNotTrack === "1" )) || (navigator.msDoNotTrack && navigator.msDoNotTrack === "1") || ("msTrackingProtectionEnabled" in window.external && window.external.msTrackingProtectionEnabled()); -if(ackeeTracker){ +if(typeof ackeeTracker !== "undefined"){ ackeeTracker .create("https://peek.eeems.website", { detailed: !dnt }) .record("b03e9427-2236-4411-98df-104b8504c51b"); @@ -12,14 +12,18 @@ if(ackeeTracker){ console.error("ackeeTracker is missing"); } if(!dnt){ - Sentry.init({ - dsn: "https://5157ded602bc413eab75d2b897ba49e0@sentry.eeems.codes/3", - integrations: [new Sentry.Integrations.BrowserTracing()], - tracePropagationTargets: ["localhost", "127.0.0.1", "remarkable.guide", /^\//], - tracesSampleRate: 1.0, - }); + if(typeof Sentry !== "undefined"){ + Sentry.init({ + dsn: "https://5157ded602bc413eab75d2b897ba49e0@sentry.eeems.codes/3", + integrations: [new Sentry.Integrations.BrowserTracing()], + tracePropagationTargets: ["localhost", "127.0.0.1", "remarkable.guide", /^\//], + tracesSampleRate: 1.0, + }); + }else{ + console.error("Sentry is missing"); + } } -window.addEventListener('DOMContentLoaded', function(){ +function setup(){ document .querySelectorAll('img.screenshot') .forEach(function(img){ @@ -49,4 +53,9 @@ window.addEventListener('DOMContentLoaded', function(){ } }); }); -}); +} +if(document.readyState == "loading"){ + window.addEventListener('DOMContentLoaded', setup); +}else{ + setup(); +} diff --git a/src/conf.py b/src/conf.py index 1b6fa4e..01ee755 100644 --- a/src/conf.py +++ b/src/conf.py @@ -21,7 +21,6 @@ html_use_opensearch = "https://remarkable.guide" html_js_files = [ "https://peek.eeems.website/peek.js", - f"oxide.js?_t={time.time()}", ( "https://browser.sentry-cdn.com/6.16.1/bundle.tracing.min.js", { @@ -29,6 +28,7 @@ "crossorigin": "anonymous", }, ), + f"oxide.js?_t={time.time()}", ( "https://giscus.app/client.js", {