feat: enable context isolation by default (#26890)
* feat: enable context isolation by default * chore: set default in ctx iso getter * spec: make all specs work with the new contextIsolation default * spec: fix affinity specs * spec: update tests for new ctx iso default * spec: update tests for new ctx iso default * spec: update tests for new ctx iso default * spec: update tests for new ctx iso default * chore: move stray prod deps to dev deps * spec: update tests for new ctx iso default * turn off contextIsolation for visibility tests * turn off contextIsolation for <webview> tag nodeintegration attribute loads native modules when navigation happens Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
parent
2d0ad0b96a
commit
186301e126
37 changed files with 291 additions and 194 deletions
|
@ -17,7 +17,7 @@ ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('deskt
|
|||
let w: BrowserWindow;
|
||||
|
||||
before(async () => {
|
||||
w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true } });
|
||||
w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true, contextIsolation: false } });
|
||||
await w.loadURL('about:blank');
|
||||
});
|
||||
|
||||
|
@ -96,7 +96,7 @@ ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('deskt
|
|||
});
|
||||
|
||||
it('disabling thumbnail should return empty images', async () => {
|
||||
const w2 = new BrowserWindow({ show: false, width: 200, height: 200 });
|
||||
const w2 = new BrowserWindow({ show: false, width: 200, height: 200, webPreferences: { contextIsolation: false } });
|
||||
const wShown = emittedOnce(w2, 'show');
|
||||
w2.show();
|
||||
await wShown;
|
||||
|
@ -116,7 +116,7 @@ ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('deskt
|
|||
});
|
||||
|
||||
it('getMediaSourceId should match DesktopCapturerSource.id', async () => {
|
||||
const w = new BrowserWindow({ show: false, width: 100, height: 100 });
|
||||
const w = new BrowserWindow({ show: false, width: 100, height: 100, webPreferences: { contextIsolation: false } });
|
||||
const wShown = emittedOnce(w, 'show');
|
||||
const wFocused = emittedOnce(w, 'focus');
|
||||
w.show();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue