mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 05:57:02 +09:00
fix invalid certificate authority for localhost
This commit is contained in:
parent
8d0a8d0014
commit
aa479647a8
1 changed files with 15 additions and 0 deletions
15
electron.js
15
electron.js
|
@ -1,3 +1,5 @@
|
|||
'use strict';
|
||||
|
||||
const electron = require('electron');
|
||||
const { app, BrowserWindow, session, nativeTheme, ipcMain } = require('electron');
|
||||
const { is, fixPathForAsarUnpack } = require('electron-util');
|
||||
|
@ -206,4 +208,17 @@ app.on('open-url', (e, url) => {
|
|||
Util.send(mainWindow, 'route', Util.getRouteFromUrl(url));
|
||||
mainWindow.show();
|
||||
};
|
||||
});
|
||||
|
||||
app.on('certificate-error', (e, webContents, url, error, certificate, callback) => {
|
||||
const u = new URL(url);
|
||||
|
||||
console.log(url, u);
|
||||
|
||||
if ([ '127.0.0.1', 'localhost' ].includes(u.hostname)) {
|
||||
e.preventDefault();
|
||||
callback(true);
|
||||
} else {
|
||||
callback(false);
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue