I have added a new-window event listener to my webview, but it doesn't work unless I have allowpopups set on it. The thing is, when allowpopups is set, it automatically creates a new window which I don't want. Here's a snippet of my code:
view.addEventListener('new-window', (e) => {
// I thought `preventDefault` could work, but it doesn't.
e.preventDefault();
// This function creates a new tab in the browser that I'm making
createTab(e.url);
});
Is there a way to prevent the window from popping up?