fix: crash loading about:blank
in subframes (35-x-y) (#45758)
* fix: crash loading `about:blank` in subframes (#45694) fix: crash loading about:blank in subframes * chore: e patches all --------- Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
768daef27b
commit
0a543f389d
4 changed files with 44 additions and 10 deletions
|
@ -217,6 +217,40 @@ describe('renderer nodeIntegrationInSubFrames', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('subframe with non-standard schemes', () => {
|
||||
it('should not crash when changing subframe src to about:blank and back', async () => {
|
||||
const w = new BrowserWindow({ show: false, width: 400, height: 400 });
|
||||
|
||||
const fwfPath = path.resolve(__dirname, 'fixtures/sub-frames/frame-with-frame.html');
|
||||
await w.loadFile(fwfPath);
|
||||
|
||||
const originalSrc = await w.webContents.executeJavaScript(`
|
||||
const iframe = document.querySelector('iframe');
|
||||
iframe.src;
|
||||
`);
|
||||
|
||||
const updatedSrc = await w.webContents.executeJavaScript(`
|
||||
new Promise((resolve, reject) => {
|
||||
const iframe = document.querySelector('iframe');
|
||||
iframe.src = 'about:blank';
|
||||
resolve(iframe.src);
|
||||
})
|
||||
`);
|
||||
|
||||
expect(updatedSrc).to.equal('about:blank');
|
||||
|
||||
const restoredSrc = await w.webContents.executeJavaScript(`
|
||||
new Promise((resolve, reject) => {
|
||||
const iframe = document.querySelector('iframe');
|
||||
iframe.src = '${originalSrc}';
|
||||
resolve(iframe.src);
|
||||
})
|
||||
`);
|
||||
|
||||
expect(restoredSrc).to.equal(originalSrc);
|
||||
});
|
||||
});
|
||||
|
||||
// app.getAppMetrics() does not return sandbox information on Linux.
|
||||
ifdescribe(process.platform !== 'linux')('cross-site frame sandboxing', () => {
|
||||
let server: http.Server;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue