nw.js: The webview tag is not sized properly

Even if an explicit size has been declared, the webview tag is not sized properly when the application starts up. However, if the application’s window is manually resized, then the webview immediately gets resized properly.

Here is an example page that triggers the problem:

<html>

    <head lang="en">
        <style>
            html, body {
                height: 100%;
                margin: 0;
            }
        </style>
    </head>

    <body>
        <webview src="http://google.com/" style="width:100%; height:100%;"></webview>
    </body>

</html>

When the application is launched the webview occupies roughly the height of a single line of text. The problem happens on Mac OS X Yosemite and Windows 8.1.

This is in NW.js 0.13beta2

<bountysource-plugin>

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Reactions: 4
  • Comments: 17 (8 by maintainers)

Most upvoted comments

For anyone else that happens to run into this issue, I found that in my case (using 0.19.5-sdk), it wouldn’t change size unless I explicitly set the webview element’s display style property to flex.

ie: <webview src="..." id="..." style="display:flex; height:100%; width:100%;"></webview>