MCPcopy Index your code
hub / github.com/vercel/hyper / handleDrop

Function handleDrop

app/ui/window.ts:278–288  ·  view source on GitHub ↗
(event: Event, url: string)

Source from the content-addressed store, hash-verified

276 });
277
278 const handleDrop = (event: Event, url: string) => {
279 const protocol = typeof url === 'string' && new URL(url).protocol;
280 if (protocol === 'file:') {
281 event.preventDefault();
282 const path = fileURLToPath(url);
283 rpc.emit('session data send', {data: path, escaped: true});
284 } else if (protocol === 'http:' || protocol === 'https:') {
285 event.preventDefault();
286 rpc.emit('session data send', {data: url});
287 }
288 };
289
290 // If file is dropped onto the terminal window, navigate and new-window events are prevented
291 // and his path is added to active session.

Callers

nothing calls this directly

Calls 1

emitMethod · 0.45

Tested by

no test coverage detected