The webview tag is not sized properly
See original GitHub issueEven 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>
Issue Analytics
- State:
- Created 8 years ago
- Reactions:4
- Comments:17 (8 by maintainers)
Top Results From Across the Web
Android Webview - Webpage should fit the device screen
I have tried the following to fit the webpage based on the device screen size. mWebview.setInitialScale ...
Read more >text-size-adjust - CSS: Cascading Style Sheets - MDN Web Docs
The text-size-adjust property allows web authors to disable or modify this behavior, as web pages designed with small screens in mind do not...
Read more >Webview API - Visual Studio Code
Use the Webview API to create fully customizable views within Visual ... Our command opens a new webview panel with the correct title,...
Read more >Supporting different screens in web apps - Android Developers
... always appear at the appropriate size. WebView supports DOM, CSS, and meta tag features to help you ensure that web content is...
Read more >React Native WebView: A complete guide - LogRocket Blog
React Native WebView renders web content in a native view. Learn some of its tricks and features that you can use to your...
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
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>
This is an issue with Chrome / Chromium / Webkit. There is not a fix for this. IFrame’s has the same issue. The workaround is: