We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
webview 是类似iframe 的功能。但并不能解决,在同一个窗口打开做个页面。 类似web页面的a标签跳转。target=_blank.这样的功能
The text was updated successfully, but these errors were encountered:
能够实现新窗口打开,只是稍微麻烦点(维护一组webview/BrowserWindow):
webview/BrowserWindow
// Intercept new window behavior webview.addEventListener('new-window', e => { event.preventDefault(); // 把下面这行换掉,在另一个webview里加载这个URL webview.loadURL(e.url); });
提供了拦截new-window事件的能力,就允许自定义这个行为。类比浏览器的场景,这种做法相当于,用户点击target=_blank链接,拦截该事件,创建一个新tab/window(electron可以创建一个新webview/BrowserWindow),并加载目标URL
new-window
target=_blank
用iframe也一样,只要能拦截new-window事件,接下来怎么处理完全是自定义的,可以再创建个iframe加载它、或者盖掉当前页面、或者window.open它、或者拦截它什么都不发生……“在同一个窗口打开多个页面”可以是一个页面里放多个iframe,也就是一个BrowserWindow里放多个webview
window.open
BrowserWindow
webview
Sorry, something went wrong.
如何给多个页面设置不同的cookie呢。每一个页面加载同一个地址。
@ayqy event.preventDefault(); 并不能阻止打开新窗口, 拦截不了
No branches or pull requests
webview 是类似iframe 的功能。但并不能解决,在同一个窗口打开做个页面。
类似web页面的a标签跳转。target=_blank.这样的功能
The text was updated successfully, but these errors were encountered: