mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 05:57:02 +09:00
fix electron default session header
This commit is contained in:
parent
6551d48dfe
commit
8e84a67add
1 changed files with 11 additions and 12 deletions
23
electron.js
23
electron.js
|
@ -67,6 +67,7 @@ let csp = [
|
|||
"frame-src chrome-extension://react-developer-tools"
|
||||
];
|
||||
let autoUpdate = false;
|
||||
let appIsReady = false;
|
||||
|
||||
if (version.match('alpha')) {
|
||||
defaultChannel = 'alpha';
|
||||
|
@ -194,15 +195,6 @@ function initTray () {
|
|||
function createWindow () {
|
||||
const image = nativeImage.createFromPath(path.join(__dirname, '/electron/icon512x512.png'));
|
||||
|
||||
session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
|
||||
callback({
|
||||
responseHeaders: {
|
||||
...details.responseHeaders,
|
||||
'Content-Security-Policy': [ csp.join('; ') ]
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
initTray();
|
||||
|
||||
let state = windowStateKeeper({
|
||||
|
@ -803,6 +795,15 @@ function autoUpdaterInit () {
|
|||
};
|
||||
|
||||
app.on('ready', () => {
|
||||
session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
|
||||
callback({
|
||||
responseHeaders: {
|
||||
...details.responseHeaders,
|
||||
'Content-Security-Policy': [ csp.join('; ') ]
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
storage.get(CONFIG_NAME, (error, data) => {
|
||||
config = data || {};
|
||||
config.channel = String(config.channel || defaultChannel);
|
||||
|
@ -857,9 +858,7 @@ app.on('before-quit', (e) => {
|
|||
};
|
||||
});
|
||||
|
||||
app.on('activate', () => {
|
||||
win ? win.show() : createWindow();
|
||||
});
|
||||
app.on('activate', () => { win ? win.show() : createWindow(); });
|
||||
|
||||
app.on('open-url', (e, url) => {
|
||||
e.preventDefault();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue