MCPcopy
hub / github.com/1j01/jspaint / handleExternalLinks

Function handleExternalLinks

src/discord-activity-client.js:70–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68 });
69
70export 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
85export async function shareImage(blob, filename) {
86 const mimeType = blob.type;

Callers 1

sessions.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected