Skip to content

[Feature]: iframe like electron <webview> #5225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ankyo opened this issue Apr 30, 2025 · 1 comment
Open

[Feature]: iframe like electron <webview> #5225

ankyo opened this issue Apr 30, 2025 · 1 comment
Assignees
Labels
feature request feature request

Comments

@ankyo
Copy link

ankyo commented Apr 30, 2025

Describe the feature/enhancement you need

I just want to develop the UI interface using React, and I don't want to use WinForm. Meanwhile, I need to embed a browser window on the interface. If using Iframe, there will be security issues. Is there a similar element like Electron's in WebView2? Or can this Iframe be given some attributes to make it become a MainFrame?

UI code

function App() {
  return (
    <>
      <div className='webview'>
        <iframe name='my_site_embedding_frame' src=''></iframe>
      </div>
      <div className='order'>
        <button>Submit order</button>
      </div>
    </>
  )
}

The scenario/use case where you would use this feature

I mainly develop some efficiency tools to assist users in conducting operations conveniently on third-party websites.

How important is this request to you?

Critical. My app's basic functions wouldn't work without it.

Suggested implementation

Currently, most development scenarios require displaying remote web content on the interface. However, the current Iframe has many limitations. I even embedded two WebViews in Winform, one for displaying the UI and the other for displaying the remote content. But it was very troublesome.

What does your app do? Is there a pending deadline for this request?

No response

@ankyo ankyo added the feature request feature request label Apr 30, 2025
@RichardSteele
Copy link

I second this. AdditionalAllowedFrameAncestors allows basic embedding, but due to the iframe not being a top-level browsing context you lose certain same-site cookies and whatever else is bound to a secure context. Overlaying a second WebView2 B over a WebView2 A doesn't work if parts of A need to be displayed above B.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request feature request
Projects
None yet
Development

No branches or pull requests

3 participants