MCPcopy Create free account
hub / github.com/wavetermdev/waveterm / getClipboardURL

Function getClipboardURL

frontend/app/app.tsx:88–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86}
87
88async function getClipboardURL(): Promise<URL> {
89 try {
90 const clipboardText = await navigator.clipboard.readText();
91 if (clipboardText == null) {
92 return null;
93 }
94 const url = new URL(clipboardText);
95 if (!url.protocol.startsWith("http")) {
96 return null;
97 }
98 return url;
99 } catch (e) {
100 return null;
101 }
102}
103
104async function handleContextMenu(e: React.MouseEvent<HTMLDivElement>) {
105 e.preventDefault();

Callers 1

handleContextMenuFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected