fix(windows): init scripts sometimes get executed too late
Reference: https://github.com/tauri-apps/wry/pull/1418#discussion_r2005617414, https://github.com/tauri-apps/tauri/issues/12990
- Fix init script sometimes get executed too late on Windows WebView2
- Init scripts are always executed on all frames on Windows WebView2
-
WebViewAttributes::initialization_scriptstakesVec::<InitializationScript>now instead ofVec::<(String, bool)>
@amrbashir @tweidinger
Package Changes Through 4dadee4666944d3e65e778fb42f2d4569721eded
There are 1 changes which include wry with minor
Planned Package Versions
The following package releases are the planned based on the context of changes in this pull request.
| package | current | next |
|---|---|---|
| wry | 0.50.5 | 0.51.0 |
Add another change file through the GitHub UI by following this link.
Read about change files or the docs at github.com/jbolda/covector
I think we should preserve the selective injection if possible due to https://github.com/tauri-apps/tauri/security/advisories/GHSA-57fm-592m-34r7 being an issue in the past. Is there another way to fix the issue without reverting @Legend-Master ?
I can not think of another way at the moment, the method amr used is what I was thinking as well, but it doesn't quite work the way we expected it to
One possible way is we add in some checks in the javascript we would inject, and let that detect if we're in an iframe or not, but I don't know how feasible it is and I don't really like that to be honest
Maybe we can open a feature request in webview2's feedback repo (seems like there's one already), but that won't fix the problem we currently have
we should really fix this
looks like the only way is to indeed inject on all frames