fix: failed to load blobs in electron (#1927)

This commit is contained in:
Peng Xiao
2023-04-13 23:14:46 +08:00
committed by GitHub
parent 934e242116
commit 42756045bb
7 changed files with 27 additions and 32 deletions

View File

@@ -36,6 +36,7 @@ export function registerProtocol() {
const realpath = toAbsolutePath(url);
// console.log('realpath', realpath, 'for', url);
callback(realpath);
return true;
});
protocol.registerFileProtocol('assets', (request, callback) => {
@@ -43,6 +44,7 @@ export function registerProtocol() {
const realpath = toAbsolutePath(url);
// console.log('realpath', realpath, 'for', url);
callback(realpath);
return true;
});
}
@@ -60,7 +62,6 @@ export function registerProtocol() {
'DELETE',
'OPTIONS',
];
// responseHeaders['Content-Security-Policy'] = ["default-src 'self'"];
}
callback({ responseHeaders });