Fix ERR_FAILED for splash screen on windows sometimes (#5539)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2022-06-01 16:25:33 -04:00
1 parent ec1df4717d
commit 06db3119a6
8 files changed
+41 -92

No files matched your search

-18
View File
@@ -1,18 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
// Register custom protocols
import { protocol } from "electron";
import path from "path";
export function registerFileProtocol(name: string, basePath: string) {
protocol.registerFileProtocol(name, (request, callback) => {
const filePath = request.url.replace(`${name}://`, "");
const absPath = path.resolve(basePath, filePath);
callback({ path: absPath });
});
}