<webview> NewWindow.attach is broken on 0.48.0+
See original GitHub issueNWJS Version : 0.48.0+ (tested with 0.48.0, 0.48.3, 0.49.0-beta1, all dev) Operating System : Linux x64
Expected behavior
After attaching new window to a webview as documented here you should be able to interact with the page with keyboard and mouse.
Actual behavior
Window is attached to the webview and appears to be responsive. Can interact with the page via DevTools (e.g. set input value). However, clicking on anything within the page has no effect.
It does work correctly using 0.47.3 so I’m hoping it’ll be possible to isolate what broke it.
How to reproduce
package.json
{
"name": "newwindow",
"main": "index.html"
}
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>newwindow</title>
<style>
html,
body {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<webview src="https://www.encodedna.com/javascript/demo/open-new-window-using-javascript-method.htm"></webview>
<script>
document.querySelector('webview').addEventListener('newwindow', e => {
const webview = document.createElement('webview');
webview.style.width = '50vw';
webview.style.height = '50vh';
webview.style.position = 'absolute';
webview.style.border = 'solid 2px red';
webview.style.left = '0';
webview.style.top = '0';
document.body.appendChild(webview);
e.window.attach(webview);
});
setTimeout(() => {
nw.Window.get(window).showDevTools();
}, 100);
</script>
</body>
</html>
Run it and click on ‘Open new window’ withing the demo page. Try to interact with the popup.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Android WebView links to same window with target=_blank to ...
I have a hybrid app that uses WebView to render external html from my own site. It had a problem that if any...
Read more >WebView - Android Developers
Retrieve a unique token identifying the top-level "real" window of the window that this view is attached to. int[], getAttributeResolutionStack(int ...
Read more >`<webview>` Tag | Electron
Use the webview tag to embed 'guest' content (such as web pages) in your Electron app. The guest content is contained within the...
Read more >webview Tag - Google Chrome
Use the webview tag to embed 'guest' content (such as web pages) in your ... attach. NewWindow.attach(object webview). Attach the requested target page...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Simply created via form: https://bugs.chromium.org/p/chromium/issues/detail?id=1136645
@mkazlauskas
Thanks