1 | initial version |
To enable inclusion of http links within an iframe on a .NET Core 6 Blazor Hybrid application, you can add a Content Security Policy (CSP) that allows the loading of external resources.
app.Use(async (context, next) =>
{
context.Response.Headers["Content-Security-Policy"] = "default-src 'self' https:";
await next();
});
<iframe src="http://example.com"></iframe>
This should allow the inclusion of http links within iframes in your Blazor Hybrid application. Note that this approach can potentially expose your application to security risks, so use it with caution and only allow trusted domains.