(files)
| 13287 | if (result.errors && result.errors.length) text += ' — ' + result.errors[0]; |
| 13288 | statusEl.textContent = text; |
| 13289 | } |
| 13290 | }); |
| 13291 | |
| 13292 | document.getElementById('cancel-browser-extension-settings')?.addEventListener('click', () => { |
| 13293 | document.getElementById('browser-extension-settings-dialog').close(); |
| 13294 | }); |
| 13295 | |
| 13296 | document.getElementById('browser-extension-store-link')?.addEventListener('click', async (e) => { |
| 13297 | e.preventDefault(); |
| 13298 | const url = e.currentTarget.getAttribute('href'); |
| 13299 | if (url && typeof window.electron?.openExternal === 'function') { |
| 13300 | await window.electron.openExternal(url); |
| 13301 | } |
| 13302 | }); |
| 13303 | |
| 13304 | async function copyTextToClipboard(text) { |
| 13305 | const value = text == null ? '' : String(text); |
| 13306 | try { |
| 13307 | if (navigator.clipboard && typeof navigator.clipboard.writeText === 'function') { |
| 13308 | await navigator.clipboard.writeText(value); |
| 13309 | return true; |
| 13310 | } |
| 13311 | } catch (_) { /* fall through */ } |
| 13312 | try { |
| 13313 | const ta = document.createElement('textarea'); |
| 13314 | ta.value = value; |
no test coverage detected