MCPcopy Index your code
hub / github.com/OpenAgentPlatform/Dive / initProtocol

Function initProtocol

electron/main/protocol.ts:28–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26])
27
28export function initProtocol() {
29 protocol.handle("local-file", (req) => {
30 const url = req.url.replace("local-file:///", process.platform === "win32" ? "file:///" : "file://")
31 return net.fetch(url)
32 })
33
34 protocol.handle("img", (req) => {
35 // Remove 'img://'
36 const url = req.url.substring(6)
37 const assetPath = path.join(process.env.VITE_PUBLIC, "image", url)
38 return net.fetch(`file://${assetPath}`)
39 })
40}

Callers 1

onReadyFunction · 0.90

Calls 1

fetchMethod · 0.80

Tested by

no test coverage detected