Skip to content

Commit c45f252

Browse files
feat: copy magnet link
1 parent eb90609 commit c45f252

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/sidepanel.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,16 @@ class ArgoViewer extends LitElement {
218218
const magnetURI = torrent.magnetURI;
219219
console.log("Seeding WACZ file via WebTorrent:", magnetURI);
220220

221-
alert(`Magnet Link Ready:\n${magnetURI}`);
221+
// Copy to clipboard
222+
navigator.clipboard
223+
.writeText(magnetURI)
224+
.then(() => {
225+
alert(`Magnet link copied to clipboard:\n${magnetURI}`);
226+
})
227+
.catch((err) => {
228+
console.error("Failed to copy magnet link:", err);
229+
alert(`Magnet Link Ready:\n${magnetURI}`);
230+
});
222231
});
223232
}
224233

0 commit comments

Comments
 (0)