When written as a sample, webview.load_html() is sometimes called before the webview is ready.
See original GitHub issueSpecification
- Platform: Windows 10 1809 Build 17763.379
- Version: 2.4(Rendering Engine: Trident)
Description
A sample of the load_html() described in sample page is written as follows.
def load_html():
webview.load_html('<h1>This is dynamically loaded HTML</h1>')
if __name__ == '__main__':
t = threading.Thread(target=load_html)
t.start()
webview.create_window('Load HTML Example')
However, in this case, in a low-spec PC environment, such as the Atom CPU, webview#load_html() is invoked before WebView is ready and may cause an error.
As follows, it seems that it is desirable to perform the ready waiting for WebView.
def load_html():
webview.webview_ready()
webview.load_html('<h1>This is dynamically loaded HTML</h1>')
if __name__ == '__main__':
t = threading.Thread(target=load_html)
t.start()
webview.create_window('Load HTML Example')
What to expect.
The program works in many environments by writing it as shown in the sample.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to load html string in a webview? - android - Stack Overflow
To load your data in WebView. Call loadData() method of WebView wv.loadData(yourData, "text/html", "UTF-8");. You can check this example.
Read more >Chapter 4. WebView, WebKit, and WebSettings - O'Reilly
A WebView is often used to load HTML content within a native application. The WebView enables you to embed a web browser, which...
Read more >WebView - Android Developers
Overview Guides Samples Design & Quality · Android Developers · Platform · Android Studio · Google Play · Jetpack · Kotlin · Docs....
Read more >WebView Tutorial With Example In Android Studio
This method is used to load the static HTML string in a web view. loadData() function takes html string data, mime-type and encoding...
Read more >Adding WebView to your Flutter app - Google Codelabs
The plugin can render Flutter widgets over the web view. So for example it's possible to render a drop down menu over the...
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
I have changed the timeout to 15 seconds and made it to throw a separate exception if the window is not opened by then. Closing this.
When I tried to edit the above line, the error certainly no longer occurred.
Also, running the application in GPD Pocket, the error is no longer occur, it is considered to have been sufficiently effective.