tauri
tauri copied to clipboard
[bug] Can't not load some webpages in iframe
Describe the bug
I am creating an app to show content from different resources, one of those resources is any web, but when I try to create a window and set the user URL inside a iframe that is refused. Any idea how to fix it, or it is possible to do that, or is it not a good idea to use Tauri for this kind of app?
My configuration is
tauri.conf.json
"security": {
"csp": "default-src 'self'; frame-src *; sandbox allow-downloads allow-presentation;"
},
And inside my .js I am creating a new window, that window has an iframe inside that tries to load the external content...
new WebviewWindow(label, {url:'app/window/browser.html'})
browser.html
<iframe src="${this.config.url}" allowfullscreen allowtransparency="allowtransparency" ></iframe>
And this is the error
Reproduction
No response
Expected behavior
No response
Platform and versions
MacOS - Lastest version
我现在就是http嵌套web 一直被拒绝访问 有什么办法解决在iframe内嵌时候
I also encountered the same problem
Any update on this or anyone has a work around?
No, I talked in the Discord Channel, and apparently, they don't have this in their roadmap. ElectronJS supports a tag named WEBVIEW to embed external web content without the IFRAME limitations... In my development project this feature is a must so sadly I had to switch to a more mature framework like ElectronJS. I hope they support it someday.
https://beta.tauri.app/blog/tauri-2-0-0-beta/#multiwebview - working on it. It won't ever match the electron webview tag but it should still cover most of the same use cases.