How to use iframe in Electron app?

I am new to Electron and need some help embedding an external webapp into iframe. I want to embed Jupyterhub in my Electron app. I was trying to use iframe for that but it throws:

Refused to display ‘https://jupyterhuburlhere’ in a frame because an ancestor violates the following Content Security Policy directive: “frame-ancestors *”.

I am using:
Angular : 7
Electron : 5
os : mac

To understand little more about this issue, I created a simple Angular 7 project and embedded my jupyterhub into iframe and it works fine.

so I am guessing, there is something in Electron that is blocking iframe.
I tried using webview in Electron and it works, but the reason I want to use iframe is because I need two way communication channel.
If there is some other way of achieving that, that works too.

thanks in advance!

It’s not Electron that’s blocking it, it’s your Jupyterhub app’s CSP. Judging from the MDN page, the * wildcard only applies to http: and https: schemes, so by specifying any frame-ancestors it won’t allow the file: scheme of your electron app’s page to view it. I could be wrong on that, but it’s seems like something that’d need to be fixed on the Jupyterhub side not in Electron.

The reason your webview is working is due to it being a whole new chromium view, rather than an embedded frame.