mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 21:38:44 +08:00
feat: electron app (#1586)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { protocol } from 'electron';
|
||||
import { join } from 'path';
|
||||
|
||||
export function registerProtocol() {
|
||||
protocol.interceptFileProtocol('file', (request, callback) => {
|
||||
const url = request.url.replace(/^file:\/\//, '');
|
||||
if (url.startsWith('./')) {
|
||||
const realpath = join(
|
||||
__dirname,
|
||||
'../../../resources/web-static',
|
||||
decodeURIComponent(url)
|
||||
);
|
||||
callback(realpath);
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user