Open hyuri opened 2 months ago
To clarify - the API for webview isn't:
web_view.set_content = ("", html_content)
it's
web_view.set_content("", html_content)
The difference is critical - it's a method invocation with 2 arguments, not a single assignment of a tuple. We need 2 arguments to set static "non-URL" content.
That said - URL and content based initialisation are mutually exclusive, so we could use the interpretation that if content is specified, URL is the used as the root URL for the raw content.
To clarify - the API for webview isn't: [...]
Sorry, that was a typo. Fixed.
That said - URL and content based initialisation are mutually exclusive, so we could use the interpretation that if content is specified, URL is the used as the root URL for the raw content.
Makes sense. With a note about that in the docs, for extra clarity, sounds pretty reasonable.
Currently working on this!
What is the problem or limitation you are having?
Similar to #2307
Right now, unlike with URL, to create a WebView and set [HTML] content to it, we have to do it in two steps:
Describe the solution you'd like
WebView already allows passing a URL during instantiation, so why not allow passing "content" as well? That way we can do it in one step, and be consistent with MainWindow and ScrollContainer:
Describe alternatives you've considered
None
Additional context
No response