feat: enhance native window.open to match the custom implementation's behavior (#19703)
Co-authored-by: Andy Locascio <andy@slack-corp.com>
This commit is contained in:
parent
b1f4ac00f0
commit
74372d65ae
20 changed files with 350 additions and 143 deletions
|
@ -3,7 +3,7 @@
|
|||
const { webContents } = require('electron');
|
||||
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal');
|
||||
const ipcMainUtils = require('@electron/internal/browser/ipc-main-internal-utils');
|
||||
const parseFeaturesString = require('@electron/internal/common/parse-features-string');
|
||||
const { parseFeaturesString } = require('@electron/internal/common/parse-features-string');
|
||||
const { syncMethods, asyncMethods, properties } = require('@electron/internal/common/web-view-methods');
|
||||
const { serialize } = require('@electron/internal/common/type-utils');
|
||||
|
||||
|
@ -141,17 +141,6 @@ const createGuest = function (embedder, params) {
|
|||
}
|
||||
});
|
||||
|
||||
// Forward internal web contents event to embedder to handle
|
||||
// native window.open setup
|
||||
guest.on('-add-new-contents', (...args) => {
|
||||
if (guest.getLastWebPreferences().nativeWindowOpen === true) {
|
||||
const embedder = getEmbedder(guestInstanceId);
|
||||
if (embedder != null) {
|
||||
embedder.emit('-add-new-contents', ...args);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return guestInstanceId;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue