when I convert my HTML file, to which I added Content Security Policy, into IMG format, the rules I set are overridden, and requests are made to unauthorized addresses. I am adding the following meta tags to my HTML file. Although it works correctly when viewed as HTML, these rules do not work correctly when I convert it to PNG using "NReco.ImageGenerator.HtmlToImageConverter".
string sContentSecurityPolicy = "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">";
sContentSecurityPolicy += "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">";
sContentSecurityPolicy += "<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'self' {0} 'unsafe-eval' 'unsafe-inline'; frame-src 'self' {0} data:; frame-ancestors 'self' {0}; object-src 'self'; img-src * blob: data: \">";
sContentSecurityPolicy = string.Format(sContentSecurityPolicy, sSecureDomainList);
var htmlToImageConv = new NReco.ImageGenerator.HtmlToImageConverter();
htmlToImageConv.Width = 756;
byte[] imgBytes = htmlToImageConv.GenerateImageFromFile(filePathHtml, NReco.ImageGenerator.ImageFormat.Png);
I tried converting the HTML code directly and also tried saving and then converting it.