From c027bc5edec6505da95490ab1acefe5cd6c35359 Mon Sep 17 00:00:00 2001 From: axtlos Date: Fri, 29 Dec 2023 23:17:21 +0100 Subject: Add anti chrome and brave detection --- antiChrome_Brave.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 antiChrome_Brave.js (limited to 'antiChrome_Brave.js') diff --git a/antiChrome_Brave.js b/antiChrome_Brave.js new file mode 100644 index 0000000..9070376 --- /dev/null +++ b/antiChrome_Brave.js @@ -0,0 +1,17 @@ + (async function(){ + var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor); + var isBrave = (navigator.brave && await navigator.brave.isBrave()) || false; + if (isBrave) { + window.location.href = 'https://axtlos.neocities.org/not-very-brave.html'; + } + else if (isChrome) { + var warningDiv = document.createElement('div'); + warningDiv.style.backgroundColor = '#f8d7da'; + warningDiv.style.color = '#721c24'; + warningDiv.style.padding = '20px'; + warningDiv.style.margin = '10px'; + warningDiv.style.border = '1px solid #f5c6cb'; + warningDiv.style.borderRadius = '5px'; + warningDiv.innerHTML = 'Warning: You appear to be using the chrome browser! While it is your right to choose whatever software to use, you should be aware of the monopolistic position google is building with their Chrome browser and the freedoms they take away from you by using chrome! Such as the freedom to use ad blockers.'; + document.body.appendChild(warningDiv); + }})(); -- cgit v1.2.3