| 68 | }); |
| 69 | |
| 70 | export function handleExternalLinks() { |
| 71 | document.addEventListener("click", (e) => { |
| 72 | if (e.defaultPrevented) return; |
| 73 | const target = e.target; |
| 74 | if (target instanceof HTMLAnchorElement && target.href && target.target === "_blank") { |
| 75 | e.preventDefault(); |
| 76 | discordSdk.commands.openExternalLink({ url: target.href }); |
| 77 | } |
| 78 | }); |
| 79 | window.open = (url) => { |
| 80 | discordSdk.commands.openExternalLink({ url }); |
| 81 | return null; |
| 82 | }; |
| 83 | } |
| 84 | |
| 85 | export async function shareImage(blob, filename) { |
| 86 | const mimeType = blob.type; |