-
Notifications
You must be signed in to change notification settings - Fork 176
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
HTML failing to render on Windows 10 #96
Comments
It sounds like something that happens to us at Tauri during the dev process on windows. This following snippet is from the actix example (run it from an administrator console)
https://github.com/Boscop/web-view/tree/master/examples#actix |
Cheers for the quick response! |
Out of curiosity I also tried the same source files on Linux (specifically Ubuntu 19.04). Trying to build the project now results in a panic as below:
If it helps, running the
|
Hi, that issue you have on Linux is actually different from the one in Windows, you need to have webkit2gtk library installed on your Linux system so build.rs from webview-sys can find it through pkg-config. |
Also, could you try running your example without the edge feature if you get the same error? |
Ah! Cheers @Zxey for that comment RE: Linux. That's fixed that issue and it's fully working as I expect! I also updated the Can I please ask what (dependency/dependencies) the Edge feature requires in order to work? I have Edge available on my machine - but I'm assuming it's a specific version it's looking for? Does it need the Preview Chromium based versions? My understanding is that without this feature, Web-View will fall back to using IE on Windows (which by default is IE7). I can work round this with the necessary registery key changes so that it doesn't use the emulation mode for content (therefore using IE11), but I'd rather rely on the Edge engine if at all possible! |
Edge should not have any dependencies on Windows 10. This is probably a bug I need to look into more. |
Gotcha. Cheers for clariying! If there's no objections I'll fork this repo and update the documentation to be a bit more comprehensive for newcomers such as myself. I'll see if I can raise a PR sometime this week. |
Sure, go ahead! Thanks! |
So I've been playing around with this on my machine and I thought I'd share my progress. When using the example code I shared above, and attaching Visual Studio to the process I can see that the crash occurs in I can also see that the private:
void on_message(const char* msg)
{
this->invoke_cb(this, msg);
}
void resize()
{
RECT r;
GetClientRect(m_window, &r);
Rect bounds(r.left, r.top, r.right - r.left, r.bottom - r.top);
m_webview.Bounds(bounds); // Exception and crash occurs on this line.
}
WebViewControlProcess m_process;
WebViewControl m_webview = nullptr; // Suspected cause.
std::string init_js = "";
void* user_data = nullptr;
webview_external_invoke_cb_t invoke_cb;
}; This is the immediate cause of the crash when you try to interact with the application window by minimising it etc as the previous address (say // Windows.Web.UI.Interop.h
template <typename D> void consume_Windows_Web_UI_Interop_IWebViewControlSite<D>::Bounds(Windows::Foundation::Rect const& value) const
{
check_hresult(WINRT_SHIM(Windows::Web::UI::Interop::IWebViewControlSite)->put_Bounds(get_abi(value)));
} This doesn't explain why the content fails to render in the first place (unless I'm missing something obvious), but it also might be interesting to note that I get the same behaviour with all versions of web-view that have the edge feature switch available - namely:
I'm curious if anyone knows of a specific commit / tag etc that is known to work on Windows 10 as intended! Unfortunately my understanding of C++ / C is rather basic so I'm likely to be of little help for actually fixing this! My apologies! |
Are you running as Administrator? Edge webview does not work when run as Administrator. |
@sopium That's a brilliant find - I didn't know the Edge webview had such a limitation! Running in standard mode renders the content as expected. I'll update the documentation with a reference to this as it doesn't seem to be a high priority fix in the |
Thanks to @sopium the root cause of issue #96 has been identified. As such the `README.md` file has been updated to highlight the fact that the bug exists in the internal Edge WebView implementation (rather than this library's abstraction).
Prelude
I'm quite new to Rust so it's very likely I've missed something simple! If that's the case I'll apologise now in advance! Any suggestions on how I can provide more information, or further diagnose the issue please do let me know.
System Information: Windows 10 Pro 10.0.18362
The Issue
The issue I'm having is that my
example-project
application won't render any HTML (it just shows an empty application window) when I execute:cargo run
. Interestingly enough though it works perfectly if I run theexample_project.exe
in the/target/debug
directory.As a side note, if I try to interact with the application window created by
cargo run
(for example by minimising it) I will get the following fault in my console:This is probably just a red-herring due to the application being in some unintended state, but for the sake of completeness the application error I get in the Event Viewer is as follows:
Full Context
Using a slightly modified
elm-counter.rs
file as an example I have the followingmain.rs
file:And an
index.html
file in the same (src) directory:The only dependency I have defined in my
Cargo.toml
file isweb-view
, but I don't think anything else is required:Thank you for your time!
The text was updated successfully, but these errors were encountered: