Disable unused features in webviews
This commit is contained in:
parent
842efb51c6
commit
1d4c7e4876
@ -62,6 +62,16 @@ export default class Application {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Disable unused features
|
||||
app.on('web-contents-created', (e, contents) => {
|
||||
contents.on('will-attach-webview', (e, webPreferences, params) => {
|
||||
delete webPreferences.preload;
|
||||
webPreferences.nodeIntegration = false;
|
||||
|
||||
// TODO: Here would be a good place to filter accessed urls (params.src). Also consider 'will-navigate' event on contents.
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private setupSystemTray() {
|
||||
|
Loading…
Reference in New Issue
Block a user