wry icon indicating copy to clipboard operation
wry copied to clipboard

fix(windows): init scripts sometimes get executed too late

Open Legend-Master opened this issue 11 months ago • 3 comments

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_scripts takes Vec::<InitializationScript> now instead of Vec::<(String, bool)>

@amrbashir @tweidinger

Legend-Master avatar Mar 26 '25 02:03 Legend-Master

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

github-actions[bot] avatar Mar 26 '25 02:03 github-actions[bot]

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 ?

tweidinger avatar Mar 26 '25 13:03 tweidinger

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

Legend-Master avatar Mar 26 '25 14:03 Legend-Master

we should really fix this

lucasfernog avatar Apr 06 '25 13:04 lucasfernog

looks like the only way is to indeed inject on all frames

lucasfernog avatar Apr 06 '25 13:04 lucasfernog