Skip to content

Commit

Permalink
fix: webui copy button for non secured environments
Browse files Browse the repository at this point in the history
  • Loading branch information
g0ldyy committed Jul 7, 2024
1 parent 578c9c7 commit 8eda672
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions comet/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,16 @@

copyLinkButton.addEventListener("click", () => {
const settings = getSettings();
navigator.clipboard.writeText(`${window.location.origin}/${btoa(JSON.stringify(settings))}/manifest.json`).then(() => {
copyAlert.toast();
});

const textArea = document.createElement("textarea");
textArea.value = `${window.location.origin}/${btoa(JSON.stringify(settings))}/manifest.json`;
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
document.execCommand("copy");
document.body.removeChild(textArea);

copyAlert.toast();
});

installButton.addEventListener("click", () => {
Expand Down

0 comments on commit 8eda672

Please sign in to comment.