electron/spec/fixtures/api/window-open-preload.js
Alexandre Lacheze b4276835d8 fix: lost window.opener after cross-origin navigation (#18173)
* Get a site instance related to current one instead of creation a new one

Using `GetRelatedSiteInstance` will keep the relation (same browsing instance) between the current and the new site instance.

* Some relies on preloads in opened window

The fact that, now, we always have an opener for opened windows diables note integration in opened windows, except if `nodeIntegrationInSubFrames` is enabled.

* Add a test on window.opener after cross-orgin navigation

* Make sure to unregisterProtocol in tests

* Introduc and use a NetworkSandbox for tests

* Modify tests about zoom persistence to properly simulate cross-origin navigation

* Revert "Modify tests about zoom persistence to properly simulate cross-origin navigation"

This reverts commit 0a7537f2eb7f183ddec16637e8a2e92a0d600321.
2019-06-03 13:23:15 -07:00

9 lines
292 B
JavaScript

const { ipcRenderer } = require('electron')
setImmediate(function () {
if (window.location.toString() === 'bar://page') {
const windowOpenerIsNull = window.opener == null
ipcRenderer.send('answer', process.argv, typeof global.process, windowOpenerIsNull)
window.close()
}
})