mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-22 14:57:52 +01:00
add dnt for nojs matomo
This commit is contained in:
parent
6b34a91587
commit
33cc4bab1f
1 changed files with 9 additions and 0 deletions
|
@ -139,6 +139,11 @@ function lightOrDark(color) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isDntEnabled(req) {
|
||||||
|
const dntHeader = req.header('DNT');
|
||||||
|
return dntHeader && (dntHeader === '1' || dntHeader === 'true');
|
||||||
|
}
|
||||||
|
|
||||||
function IsInArray(array, id) {
|
function IsInArray(array, id) {
|
||||||
for (var i = 0; i < array.length; i++) {
|
for (var i = 0; i < array.length; i++) {
|
||||||
if (array[i].id === id) return true;
|
if (array[i].id === id) return true;
|
||||||
|
@ -249,10 +254,13 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
var isSchoolProxy = "";
|
var isSchoolProxy = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// unused
|
||||||
let badges = "";
|
let badges = "";
|
||||||
let comments = "";
|
let comments = "";
|
||||||
let nnn = "";
|
let nnn = "";
|
||||||
|
|
||||||
|
const dnt_val = isDntEnabled(req)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
inv_vid?.error ===
|
inv_vid?.error ===
|
||||||
"The uploader has not made this video available in your country" ||
|
"The uploader has not made this video available in your country" ||
|
||||||
|
@ -301,6 +309,7 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
discord,
|
discord,
|
||||||
turntomins,
|
turntomins,
|
||||||
twitch,
|
twitch,
|
||||||
|
dnt_val,
|
||||||
reddit,
|
reddit,
|
||||||
channel_uploads,
|
channel_uploads,
|
||||||
secure,
|
secure,
|
||||||
|
|
Loading…
Reference in a new issue