From 2028d0e1cea3abb4b3fb492311ac0b7b961c6163 Mon Sep 17 00:00:00 2001 From: Mubelotix Date: Wed, 30 Aug 2023 09:39:09 +0200 Subject: [PATCH] Detect Brave browsers --- no-wei.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/no-wei.js b/no-wei.js index fe79369..b04d341 100644 --- a/no-wei.js +++ b/no-wei.js @@ -15,11 +15,12 @@ window.addEventListener("load", function() { const uaHasSafari = navigator.userAgent.includes("Safari"); const uaHasOpera = navigator.userAgent.includes("OPR"); const uaHasEdge = navigator.userAgent.includes("Edg"); + const isBrave = (window.navigator.brave !== undefined && window.navigator.brave.isBrave.name === "isBrave"); const isDismissed = window.localStorage["nowei-isDismissed"]; // User agent is okay, or banner was dismissed - if (!uaHasChrome || uaHasFox || uaHasOpera || uaHasEdge || allowDismissal && isDismissed === "true") { + if (!uaHasChrome || uaHasFox || uaHasOpera || uaHasEdge || isBrave || allowDismissal && isDismissed === "true") { return; } else if (uaHasChrome && uaHasSafari) { // UA is Chrome const noWei = document.createElement("div");