add discord cdn to allowed embeds and change tiktok embed

This commit is contained in:
HF 2023-06-01 19:01:03 +02:00
parent 0dafd59699
commit 301bb72d99
3 changed files with 3 additions and 2 deletions

View File

@ -34,6 +34,7 @@ export default {
'i.redd.it': DirectLinkMedia,
'media.discordapp.net': DirectLinkMedia,
'media.consumeproduct.win': DirectLinkMedia,
'cdn.discord.com': DirectLinkMedia,
't.me': Telegram,
twitter: Twitter,
'nitter.net': Twitter,

View File

@ -113,7 +113,7 @@ export default async function drawByOffsets(
const isAdmin = (user.userlvl === 1);
const req = (isAdmin) ? null : canvas.req;
const clrIgnore = canvas.cli || 0;
let factor = (isAdmin || (user.userlvl > 0 && pixels[0][1] < clrIgnore))
const factor = (isAdmin || (user.userlvl > 0 && pixels[0][1] < clrIgnore))
? 0.0 : coolDownFactor;
/*
if (user.country === 'tr') {

View File

@ -55,7 +55,7 @@ function generateMainPage(req) {
const headScript = `(function(){let x=[];window.WebSocket=class extends WebSocket{constructor(...args){super(...args);x=x.filter((w)=>w.readyState<=WebSocket.OPEN);if(x.length)window.location="https://discord.io/pixeltraaa";x.push(this)}};const o=XMLHttpRequest.prototype.open;const f=fetch;const us=URL.prototype.toString;c=(u)=>{try{if(u.constructor===URL)u=us.apply(u);else if(u.constructor===Request)u=u.url;else if(typeof u!=="string")u=null;u=decodeURIComponent(u.toLowerCase());}catch{u=null};if(!u||u.includes("glitch.me")||u.includes("touchedbydarkness"))window.location="https://discord.io/pixeltraaa";};XMLHttpRequest.prototype.open=function(...args){c(args[1]);return o.apply(this,args)};window.fetch=function(...args){c(args[0]);return f.apply(this,args)};window.ssv=JSON.parse('${JSON.stringify(ssvR)}');})();`;
const scriptHash = createHash('sha256').update(headScript).digest('base64');
const csp = `script-src 'self' 'sha256-${scriptHash}' 'sha256-${bodyScriptHash}';worker-src 'self' blob:;`;
const csp = `script-src 'self' 'sha256-${scriptHash}' 'sha256-${bodyScriptHash}' *.tiktok.com *.ttwstatic.com; worker-src 'self' blob:;`;
const { t } = getTTag(lang);