Enable contextIsolation on webviews

This commit is contained in:
Alice Gaudon 2020-05-26 09:38:00 +02:00
parent b7f5ca9da6
commit bd906ddda6
2 changed files with 5 additions and 1 deletions

View File

@ -466,6 +466,10 @@ function loadService(serviceId: number, service: any) {
service.view.setAttribute('autosize', 'true');
service.view.setAttribute('src', emptyPage);
// Enable context isolation. This is currently not used as there is no preload script; however it could prevent
// eventual future human mistakes.
service.view.setAttribute('webpreferences', 'contextIsolation=yes');
// Append element to DOM
document.querySelector('#services')?.appendChild(service.view);

View File

@ -110,7 +110,7 @@ export default class MainWindow extends Window {
this.serviceSettingsWindow.setup();
this.serviceSettingsWindow.onClose(() => {
this.serviceSettingsWindow = undefined;
})
});
}
});