Closed djmakers closed 7 months ago
the browser already has such feature. right click on any file or folder, and copy link.
i don't exclude to duplicate the browser feature if it seems to be much needed, but at the moment i'm not sure about that. Anyway, HFS is quite flexible and one can add this text to Admin / Custom HTML / HTML Head
<script>
addEventListener('DOMContentLoaded', () =>
HFS.onEvent('fileMenu', ({ entry }) => ({
label: "Copy link",
async onClick() {
await navigator.clipboard.writeText(location + entry.n)
HFS.dialogLib.alertDialog("Link copied")
}
}))
)
</script>
took the occasion to add it to examples of customization
Feature to copy link for folders and files