mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-11-11 07:41:04 +00:00
As part of #591, all window creation was routed through a createNewWindow function. That change introduced the regression reported in #616 in which popup windows could not communicate with their parent windows. This change reverts that behavior for windows opened via JavaScript (that aren't being opened as tabs and aren't being opened in external browsers), thereby fixing the reported regression.
This commit is contained in:
parent
16aae0a937
commit
587d615085
@ -210,22 +210,30 @@ function createMainWindow(inpOptions, onAppQuit, setDockBadge) {
|
||||
};
|
||||
|
||||
const onNewWindow = (event, urlToGo, _, disposition) => {
|
||||
const preventDefault = (newGuest) => {
|
||||
event.preventDefault();
|
||||
if (newGuest) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
event.newGuest = newGuest;
|
||||
}
|
||||
};
|
||||
if (nativeTabsSupported()) {
|
||||
if (disposition === 'background-tab') {
|
||||
createNewTab(urlToGo, false);
|
||||
const newTab = createNewTab(urlToGo, false);
|
||||
preventDefault(newTab);
|
||||
return;
|
||||
} else if (disposition === 'foreground-tab') {
|
||||
createNewTab(urlToGo, true);
|
||||
const newTab = createNewTab(urlToGo, true);
|
||||
preventDefault(newTab);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!linkIsInternal(options.targetUrl, urlToGo, options.internalUrls)) {
|
||||
shell.openExternal(urlToGo);
|
||||
preventDefault();
|
||||
// eslint-disable-next-line no-useless-return
|
||||
return;
|
||||
}
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
event.newGuest = createNewWindow(urlToGo);
|
||||
};
|
||||
|
||||
const sendParamsOnDidFinishLoad = (window) => {
|
||||
|
Loading…
Reference in New Issue
Block a user