From 095d794a5a18500f925f812d3c5957dac197c325 Mon Sep 17 00:00:00 2001 From: WombatFromHell Date: Thu, 23 May 2024 08:55:29 -0600 Subject: [PATCH] Fixed Firefox Addons panel permissions button misbehaving --- src/permissions.html | 2 +- src/permissions.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/permissions.html b/src/permissions.html index d806d2fa..8d6db1a9 100644 --- a/src/permissions.html +++ b/src/permissions.html @@ -24,6 +24,6 @@

Chrome Shack Permissions

- + diff --git a/src/permissions.ts b/src/permissions.ts index 3bb4c5e0..444e32b0 100644 --- a/src/permissions.ts +++ b/src/permissions.ts @@ -35,12 +35,13 @@ const setPanelState = (granted: boolean) => { permissionBtn.innerText = "Permission Granted"; permissionBtn.setAttribute("disabled", "true"); permissionBtn.setAttribute("class", "hide"); + } else { + prompt.removeAttribute("class"); + grantText.setAttribute("class", "hide"); + permissionBtn.innerText = "Request Permission"; + permissionBtn.removeAttribute("disabled"); + permissionBtn.setAttribute("class", ""); } - prompt.removeAttribute("class"); - grantText.setAttribute("class", "hide"); - permissionBtn.innerText = "Request Permission"; - permissionBtn.removeAttribute("disabled"); - permissionBtn.setAttribute("class", ""); }; const initialize = async () => { @@ -61,7 +62,6 @@ const initialize = async () => { } }; -(async () => { - // only allow Firefox useragent's to use the permissions panel +window.onload = async (_) => { if (isFirefox()) await initialize(); -})(); +};