oops
This commit is contained in:
parent
815638b2ed
commit
d3e5482f3f
|
@ -12,7 +12,7 @@
|
|||
|
||||
(function() {
|
||||
let dnt = navigator.doNotTrack;
|
||||
if (dnt == "1") {
|
||||
if (dnt === "1") {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -20,15 +20,11 @@
|
|||
|
||||
function logTime() {
|
||||
let stopTime = new Date();
|
||||
let message = JSON.stringify(
|
||||
{
|
||||
"path": window.location.pathname,
|
||||
"start_time": startTime.toISOString(),
|
||||
"end_time": stopTime.toISOString(),
|
||||
}
|
||||
);
|
||||
|
||||
window.navigator.sendBeacon("/api/pageview-timer", message);
|
||||
window.navigator.sendBeacon("/api/pageview-timer", JSON.stringify({
|
||||
"path": window.location.pathname,
|
||||
"start_time": startTime.toISOString(),
|
||||
"end_time": stopTime.toISOString()
|
||||
}));
|
||||
}
|
||||
|
||||
window.addEventListener("pagehide", logTime, false);
|
||||
|
|
|
@ -76,7 +76,7 @@ function share_on_mastodon() {
|
|||
var url = window.location.href;
|
||||
|
||||
// get the page title from the og:title meta tag, if it exists.
|
||||
var title = document.queryselectorall('meta[property="og:title"]')[0].getattribute("content");
|
||||
var title = document.querySelectorAll('meta[property="og:title"]')[0].getattribute("content");
|
||||
|
||||
// Otherwise, use the <title> tag as the title
|
||||
if (!title) var title = document.getElementsByTagName("title")[0].innerHTML;
|
||||
|
|
Loading…
Reference in New Issue