MCPcopy Create free account
hub / github.com/curiores/SerialAnalyzer / setupLocalFilesNormalizerProxy

Function setupLocalFilesNormalizerProxy

public/electron.js:51–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49// Setup a local proxy to adjust the paths of requested files when loading
50// them from the local production bundle (e.g.: local fonts, etc...).
51function setupLocalFilesNormalizerProxy() {
52 protocol.registerHttpProtocol(
53 "file",
54 (request, callback) => {
55 const url = request.url.substr(8);
56 callback({ path: path.normalize(`${__dirname}/${url}`) });
57 },
58 (error) => {
59 if (error) console.error("Failed to register protocol");
60 }
61 );
62}
63
64// This method will be called when Electron has finished its initialization and
65// is ready to create the browser windows.

Callers 1

electron.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected