Manipulating the content of iframe, is it possible? #11059
-
I can kinda guess this has been asked in several ways and forms and manipulating the DOM of iframe poses a potential security risk as well, but wanted to ask it again to see what's possible. I want to write yet another open-source WhatsApp client where I want to attach new DOM elements to WhatsApp web interface. Is this somewhat and somehow possible with Tauri? I know the platform's main webview will highly possibly not allow me to do that but asked if, maybe, Tauri JS API maybe has a workaround for it. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It's technically possible to inject js into newly created iframes but that's currently disabled (to fix a security issue) but will be re-enabled as a config at some point (see todos here https://github.com/tauri-apps/wry/pull/1251/files) -> This is tauri's initialization_script config. Depending on idk CSP and stuff the loaded website has set this may not help much if you also need some form communication channel. For windows at least there should be native-ish apis though, i think this is a good entry point https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/frames?tabs=dotnetcsharp - generally the windows webview is the "nicest" one in this regard so on macos/linux you may not get as far. |
Beta Was this translation helpful? Give feedback.
It's technically possible to inject js into newly created iframes but that's currently disabled (to fix a security issue) but will be re-enabled as a config at some point (see todos here https://github.com/tauri-apps/wry/pull/1251/files) -> This is tauri's initialization_script config. Depending on idk CSP and stuff the loaded website has set this may not help much if you also need some form communication channel.
For windows at least there should be native-ish apis though, i think this is a good entry point https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/frames?tabs=dotnetcsharp - generally the windows webview is the "nicest" one in this regard so on macos/linux you ma…