mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 14:42:32 -05:00
share via copy
This commit is contained in:
1 parent
a588c2f4a4
commit
f09732df90
1 file changed
+7
@@ -4,6 +4,13 @@ export default class extends HTMLElement {
|
||||
|
||||
this.addEventListener('click', (e) => {
|
||||
const text = this.dataset.text || this.innerText.trim()
|
||||
const download = window.webkit?.messageHandlers?.download
|
||||
|
||||
if (download && /^https?:\/\//.test(text)) {
|
||||
e.preventDefault()
|
||||
|
||||
return download.postMessage({ url: text })
|
||||
}
|
||||
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(text).then(() => {
|
||||
|
||||
Reference in new issue
Block a user