import { session } from 'electron'; import OnResponseStartedDetails = Electron.OnResponseStartedDetails; function initSession(): void { session.defaultSession.webRequest.onHeadersReceived( (details: OnResponseStartedDetails, callback: (response: any) => void) => { callback({ responseHeaders: { ...details.responseHeaders, 'Content-Security-Policy': [ "default-src 'self'; style-src 'unsafe-eval' 'unsafe-inline'", ], }, }); } ); } export default { init: initSession };