Electron 在电子应用程序中使用window.open

Electron 在电子应用程序中使用window.open,electron,window.open,Electron,Window.open,我正在尝试从电子应用程序打开一个窗口。正在尝试将此打开的窗口节点集成设置为false const MyButton = (props: any) => { return props.url ? <a className="my-btn" onClick={() => { let win = window.open("http://www.google.com/", "_blank", "toolbar=yes,scrollbars=yes,resizab

我正在尝试从电子应用程序打开一个窗口。正在尝试将此打开的窗口节点集成设置为false

const MyButton = (props: any) => {
    return props.url ? <a className="my-btn" onClick={() => {
        let win = window.open("http://www.google.com/", "_blank", "toolbar=yes,scrollbars=yes,resizable=yes,top=500,left=500,width=400,height=400");
        console.log('Is open: ' + !win.closed);
    }} target="_blank">My Button</a> : null;
};
constmybutton=(道具:任意)=>{
返回props.url{
让win=窗口打开(“http://www.google.com/“工具栏=是,滚动条=是,可调整大小=是,顶部=500,左侧=500,宽度=400,高度=400”);
console.log('打开:'+!win.closed);
}}target=“\u blank”>我的按钮:空;
};

问题是我没有看到窗口弹出?

一个有效的解决方案是在预加载脚本中“拦截”window.open()调用。在预加载脚本中,您可以创建一个新的浏览器窗口并将其打开