Skip to content

Commit

Permalink
Fix startup if Sentry is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Aug 26, 2023
1 parent d7f5a6b commit 5d1fad4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
27 changes: 18 additions & 9 deletions src/_static/oxide.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,26 @@ 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");
}else{
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){
Expand Down Expand Up @@ -49,4 +53,9 @@ window.addEventListener('DOMContentLoaded', function(){
}
});
});
});
}
if(document.readyState == "loading"){
window.addEventListener('DOMContentLoaded', setup);
}else{
setup();
}
2 changes: 1 addition & 1 deletion src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
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",
{
"integrity": "sha384-hySah00SvKME+98UjlzyfP852AXjPPTh2vgJu26gFcwTlZ02/zm82SINaKTKwIX2",
"crossorigin": "anonymous",
},
),
f"oxide.js?_t={time.time()}",
(
"https://giscus.app/client.js",
{
Expand Down

0 comments on commit 5d1fad4

Please sign in to comment.