tauri-apps/wry

Allow injecting JS into all Webview subframes

GarettCooper opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
Hi, I have a use-case where I'd like to support plugins for my Tauri app using iframes. I was planning on injecting some initial JS to initialize the frame content with themes and metadata before the first render, instead of relying on postMessage which would cause flickering. I built a working prototype of this on Windows before realizing that it was only working because a. I was on Windows and b. I was serving the iframe content from the same origin.

Describe the solution you'd like
I would like to be able to opt-in individual initialization scripts to running on subframes within a Webview. I found the TODOs related to this feature (like here) so this is clearly something that the team intends to support at some point, but I'd like to see what I could do to push it forward. I'd be happy to implement it myself but I'm not exactly clear on what the team was envisioning with these TODOs and I don't have access to all of the platforms Wry supports to test on.