'Webview2 Invalid X-Frame-Options header encountered when loading from Html
I am using WPF application and integrated the webview2, I load the html file which have the youtube url . But some how i am getting error in console : "Invalid 'X-Frame-Options' header encountered when loading 'xyz.com/': 'ALLOW-FROM' is not a recognized directive. The header will be ignored." I have checked the x-frame-options , but somehow I am not able to understand the integration with respect to webview2.
Solution 1:[1]
The setting ALLOW-FROM is not supported by most browsers. With the imminent retirement of IE11, support for it is soon history.
It is better to use the more flexible frame-ancestors directive of Content-Security-Policy. You can use this response header instead:
Content-Security-Policy: frame-ancestors xyz.com;
This would allow xyz.com to frame your site.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Halvor Sakshaug |
