From d2ce64f73418096602ace49552783fe6c73b1f14 Mon Sep 17 00:00:00 2001 From: Dastan21 Date: Mon, 6 Feb 2023 17:22:38 +0100 Subject: [PATCH] fix: cloudflare detection & clickOutside error --- src/common/utils.js | 4 ++-- src/manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/utils.js b/src/common/utils.js index 08afbaf..2074fdf 100644 --- a/src/common/utils.js +++ b/src/common/utils.js @@ -18,7 +18,7 @@ export function getCurrentSection (title = window.title) { let section = bvaRoot.getAttribute('bva-section') if (section != null && title == null) return section title = title.toLowerCase() - if (title.startsWith('just a moment')) section = 'cloudflare' + if (document.body.classList.contains('no-js')) section = 'cloudflare' else if (title.startsWith('liste d\'animes')) section = 'anime-list' else if (title.startsWith('you searched for')) section = 'search' else if (title.endsWith('archives - voiranime') || title.includes('archives - page ')) section = 'genre-list' @@ -278,7 +278,7 @@ export function onClickOutside ($el, callback) { if ($el.__clickoutside) return const clickFunction = (e) => { - if (!e.path.some(($e) => { + if (!e.composedPath()?.some(($e) => { if ($e.tagName == null) return false return $el.isEqualNode($e) })) return diff --git a/src/manifest.json b/src/manifest.json index f5fc477..3280196 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,6 +1,6 @@ { "name": "Better VoirAnime", - "version": "0.0.4", + "version": "0.0.5", "manifest_version": 3, "description": "A powerful UI/UX changer for 'voiranime.com'", "icons": {