Skip to content
This repository has been archived by the owner on Dec 30, 2024. It is now read-only.

Commit

Permalink
Fixed Firefox Addons panel permissions button misbehaving
Browse files Browse the repository at this point in the history
  • Loading branch information
WombatFromHell committed May 23, 2024
1 parent ac6d17d commit 095d794
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/permissions.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ <h2>Chrome Shack Permissions</h2>
</div>
</section>

<script defer src="permissions.ts" type="module"></script>
<script src="permissions.ts" type="module"></script>
</body>
</html>
16 changes: 8 additions & 8 deletions src/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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();
})();
};

0 comments on commit 095d794

Please sign in to comment.