feat: add WebView::load_html for loading HTML after intialization#1368
Merged
amrbashir merged 3 commits intotauri-apps:devfrom Sep 25, 2024
Merged
feat: add WebView::load_html for loading HTML after intialization#1368amrbashir merged 3 commits intotauri-apps:devfrom
WebView::load_html for loading HTML after intialization#1368amrbashir merged 3 commits intotauri-apps:devfrom
Conversation
Contributor
Package Changes Through 481a199There are 1 changes which include wry with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
load_html for loading HTML after intializationload_html for loading HTML after intialization
This was referenced Sep 25, 2024
Contributor
Author
|
I've got a PR in my library that tests the code path for this PR: just-be-dev/webview#56. That's what I've used to test the implementation. |
Contributor
Author
|
I got someone at Recurse to verify that it works on windows as well. Still need to test on linux, but I'll get someone for that soon. My library isn't really setup to be ran on iOS or android so I'd appreciate extra scrutiny there. Overall the implementation seems straight forward though. |
load_html for loading HTML after intializationWebView::load_html for loading HTML after intialization
amrbashir
pushed a commit
to lloydzhou/wry
that referenced
this pull request
Sep 26, 2024
This was referenced Sep 26, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR aims to implement
load_html, a companion ofload_urlto balance out the current implementation. Currently, the webview can be initialized with either a URL or HTML via.with_urlor.with_htmlin the builder. After creation.load_urlcan be used to load a different URL, but the same can't be said for.load_html.In #1367 I noted that refreshing a webview initialized with
.load_htmlcauses the webview to be left with an empty screen. While that's not ideal, if this method existed it'd be easy enough to simply callload_htmlwith the same payload as what the webview was initialized with to get it back in the correct state.