Skip to content

Only one sample #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rsemenoff opened this issue Feb 23, 2020 · 2 comments
Open

Only one sample #18

rsemenoff opened this issue Feb 23, 2020 · 2 comments

Comments

@rsemenoff
Copy link

Hi, I downloaded the repository and there is only the one sample. It is actually just a web browser application. I would like to see a sample that demonstrates display of html content that is compiled into the executable, and the handling of ajax calls programmatically within the application itself.
Its not at all clear that webview2 is capable of doing any of this.

@david-risney
Copy link

Hi, thanks for your feedback! Good point. We should have a sample demonstrating application UI scenarios.

When you say HTML content compiled into the executable, we do have NavigateToString for loading HTML as a string. There's also the WebResourceRequested event for intercepting any web request and substituting your own response. Can you elaborate on how you would want to compile HTML content into the executable? As module resources you want to pull our as strings or binary blobs at runtime?

For handling AJAX calls programmatically, can you elaborate on what you want to do? Does handling the ajax call programmatically within the application mean the native code provides the HTTP response to AJAX calls initiated within the webview? WebResourceRequested may help with that.

We do have the WebView2Browser that has one WebView for displaying web content and another that acts as application UI. The application UI part is closer to what you're asking about generally but doesn't cover the specifics you mention.

@rsemenoff
Copy link
Author

To elaborate on how I would compile HTML into the executable, I dont have any specific requirement, it could be a resource string or a binary blob depending on the C++ library capabilities. Its just data that was assembled using a python application.
As far as ajax, it is simply my assumption the webview2 can actually process js, which is what I want, because I already have a python/flask app with a js UI that I want to package into a proper self-contained app and distribute via commercial channels such as the windows app store. I assume that MS is aligned with that approach, so the lack of clear sample code would seem to be an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants