fix(ui-copy): copyText utility with execCommand fallback — navigator.clipboard is gated by Secure Context (HTTPS-only) and is undefined on plain-HTTP self-hosted deployments. Apply to ExtensionKeyBar + BrowserExtensionCard.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useCredentialsStore } from '../../stores/credentials.js'
|
||||
import { copyText } from '../../utils/clipboard.js'
|
||||
|
||||
const store = useCredentialsStore()
|
||||
const showRotateConfirm = ref(false)
|
||||
@@ -37,7 +38,7 @@ onMounted(() => store.loadKey())
|
||||
async function copyKey() {
|
||||
if (!store.extensionKey) return
|
||||
try {
|
||||
await navigator.clipboard.writeText(store.extensionKey)
|
||||
await copyText(store.extensionKey)
|
||||
globalThis.window?.__fcToast?.({ text: 'Copied', type: 'success' })
|
||||
} catch {
|
||||
globalThis.window?.__fcToast?.({ text: 'Copy failed', type: 'error' })
|
||||
|
||||
Reference in New Issue
Block a user