Apr
2025
Apr
2025
Stupid Safari and iOS forcing me to do this to copy text to clipboard. 😩
1export async function copyToClipboard(text: string) { 2 try { 3 await navigator.clipboard.writeText(text); 4 } catch (err) { 5 // Fallback for devices like iOS that don't support Clipboard API 6 const textarea = document.createElement("textarea"); 7 textarea.value = text; 8 textarea.setAttribute("readonly", ""); 9 textarea.style.position = "absolute"; 10 textarea.style.left = "-9999px"; 11 document.body.appendChild(textarea); 12 13 textarea.select(); 14 document.execCommand("copy"); 15 document.body.removeChild(textarea); 16 } 17}
Mar
2025
Mar
2025
I've been working on this Obsidian plugin for quite some time and I'm really happy to say that it's finally been included in the list of community plugins!
You can find the sources and the install instructions in my GitHub profile over here. But let's delve a bit into how I came up with the idea for the plugin.