Skip to content

toga webview load local html file #2750

Answered by mhsmith
Jzhenli asked this question in Q&A
Discussion options

You must be logged in to vote

As it says in the documentation:

Due to app security restrictions, WebView can only display http:// and https:// URLs, not file:// URLs. To serve local file content, run a web server on localhost using a background thread.

This could be as simple as using the standard library http.server module as shown here.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@Jzhenli
Comment options

@mhsmith
Comment options

mhsmith Aug 8, 2024
Collaborator

@freakboy3742
Comment options

@Jzhenli
Comment options

@mhsmith
Comment options

mhsmith Aug 8, 2024
Collaborator

Answer selected by Jzhenli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants