CMP: odstranjena koda, ki je dusila Googlovo sporocilo o privolitvi
V AdSense je pod Privacy & messaging / European regulations sporocilo ze objavljeno in folx.tv je med izbranimi stranmi, prikazati pa se ni moglo, ker je client/index.html: window.googlefc.controlledMessagingFunction = message => message.proceed(false) sporocilo zavracal, funkcija hideGoogleCMP() pa je s CSS-om in MutationObserverjem sproti brisala vse elemente fc-* iz DOM-a. Oboje odstranjeno. Lastna pasica cookie-consent.tsx je bila samo importana in se sploh ni izrisovala (v App.tsx je ni bilo v drevesu), zato je stran do zdaj tekla brez kakrsnekoli privolitve - komponenta in import sta izbrisana. Posledica: promet iz EEA postane upravicen do personaliziranih oglasov namesto samo do non-personalized in limited.
This commit is contained in:
@@ -35,32 +35,6 @@
|
||||
<link rel="apple-touch-icon" href="/favicon.png" />
|
||||
<link rel="shortcut icon" href="/favicon.png" />
|
||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4465464714854276" crossorigin="anonymous"></script>
|
||||
<script>
|
||||
window.googlefc = window.googlefc || {};
|
||||
window.googlefc.ccpa = window.googlefc.ccpa || {};
|
||||
window.googlefc.callbackQueue = window.googlefc.callbackQueue || [];
|
||||
window.googlefc.controlledMessagingFunction = function(message) { message.proceed(false); };
|
||||
(function hideGoogleCMP() {
|
||||
var style = document.createElement('style');
|
||||
style.textContent = '.fc-consent-root,.fc-dialog-container,.fc-dialog-overlay,div[id^="fc-"],div[class^="fc-"]{display:none!important;visibility:hidden!important}';
|
||||
document.head.appendChild(style);
|
||||
var observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(m) {
|
||||
m.addedNodes.forEach(function(node) {
|
||||
if (node.nodeType === 1) {
|
||||
var id = node.id || '';
|
||||
var cls = node.className || '';
|
||||
if (id.indexOf('fc-') === 0 || (typeof cls === 'string' && cls.indexOf('fc-') >= 0)) {
|
||||
node.style.display = 'none';
|
||||
node.remove();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
observer.observe(document.documentElement, { childList: true, subtree: true });
|
||||
})();
|
||||
</script>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Architects+Daughter&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Fira+Code:wght@300..700&family=Geist+Mono:wght@100..900&family=Geist:wght@100..900&family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=IBM+Plex+Sans:ital,wght@0,100..700;1,100..700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Lora:ital,wght@0,400..700;1,400..700&family=Merriweather:ital,opsz,wght@0,18..144,300..900;1,18..144,300..900&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Outfit:wght@100..900&family=Oxanium:wght@200..800&family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Roboto:ital,wght@0,100..900;1,100..900&family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&family=Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900&family=Space+Grotesk:wght@300..700&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
|
||||
|
||||
@@ -22,7 +22,6 @@ import DatenschutzPage from "@/pages/datenschutz";
|
||||
import KontaktPage from "@/pages/kontakt";
|
||||
import AdminGalleryPage from "@/pages/admin-gallery";
|
||||
import AdminPushPage from "@/pages/admin-push";
|
||||
import CookieConsent from "@/components/cookie-consent";
|
||||
import MobileStickyAd from "@/components/mobile-sticky-ad";
|
||||
|
||||
// Vse povezave, ki vodijo z nase domene, se odprejo v novem zavihku. Delegiran
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { X } from "lucide-react";
|
||||
|
||||
const CONSENT_KEY = "folx_cookie_consent";
|
||||
|
||||
export default function CookieConsent() {
|
||||
const [visible, setVisible] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const consent = localStorage.getItem(CONSENT_KEY);
|
||||
if (!consent) {
|
||||
const timer = setTimeout(() => setVisible(true), 1500);
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const accept = () => {
|
||||
localStorage.setItem(CONSENT_KEY, "accepted");
|
||||
setVisible(false);
|
||||
};
|
||||
|
||||
if (!visible) return null;
|
||||
|
||||
return (
|
||||
<div
|
||||
className="fixed bottom-0 left-0 right-0 z-[9999] bg-card border-t border-card-border shadow-2xl"
|
||||
data-testid="cookie-consent-banner"
|
||||
>
|
||||
<div className="max-w-4xl mx-auto px-4 py-4 flex flex-col sm:flex-row items-start sm:items-center gap-3">
|
||||
<div className="flex-1 text-sm text-card-foreground">
|
||||
Diese Website verwendet Cookies und Google-Dienste, um Ihnen das bestmögliche
|
||||
Erlebnis zu bieten. Mit der Nutzung dieser Website stimmen Sie der Verwendung
|
||||
von Cookies zu.
|
||||
</div>
|
||||
<div className="flex items-center gap-2 flex-shrink-0">
|
||||
<button
|
||||
onClick={accept}
|
||||
className="px-5 py-2 bg-primary text-primary-foreground text-sm font-medium rounded-md hover:bg-primary/90 transition-colors"
|
||||
data-testid="button-accept-cookies"
|
||||
>
|
||||
Akzeptieren
|
||||
</button>
|
||||
<button
|
||||
onClick={accept}
|
||||
className="p-1.5 text-muted-foreground hover:text-foreground transition-colors"
|
||||
data-testid="button-close-cookies"
|
||||
>
|
||||
<X className="w-4 h-4" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user