diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html index 57f5a69..401bd92 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html @@ -456,29 +456,22 @@

Fingerprint Visualizer

const bundle = await fetchWithAuth("IntroSkipper/SupportBundle", "GET", null); const bundleText = await bundle.text(); - // Display it to the user - document.querySelector("textarea#supportBundle").value = bundleText; + // Display it to the user and select all + const ta = document.querySelector("textarea#supportBundle"); + ta.value = bundleText; + ta.focus(); + ta.setSelectionRange(0, ta.value.length); - // Attempt to copy it to the clipboard automatically, falling back to selecting - // all text and prompting the user to press ctrl c. + // Attempt to copy it to the clipboard automatically, falling back + // to prompting the user to press Ctrl + C. try { - navigator.clipboard.writeText(bundleText) + navigator.clipboard.writeText(bundleText); Dashboard.alert("Support bundle copied to clipboard"); } catch { - supportBundleCopyFailed(); + Dashboard.alert("Press Ctrl+C to copy support bundle"); } } - // if the automatic bundle copy fails (likely due to an insecure context), have the - // user copy it manually. - function supportBundleCopyFailed() { - const ta = document.querySelector("textarea#supportBundle"); - ta.focus(); - ta.setSelectionRange(0, ta.value.length); - - Dashboard.alert("Press Ctrl+C to copy support bundle"); - } - // show changed, populate seasons async function showChanged() { clearSelect(selectSeason);