Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML page is shown with broken UI While publishing the extent report HTML file on Jenkins using the 'HTML Publisher Plugin'

HTML page is shown with broken UI While publishing the extent report HTML file using the 'HTML Publisher Plugin', Can any one please guide me how can I print the complete report with proper UI

Screenshot of the report when I open the html report using the HTML publisher plugin

enter image description here

Screenshot of the report when I open the same html report file using the Firefox browser

enter image description here

like image 293
praveen.4705 Avatar asked Dec 28 '25 16:12

praveen.4705


1 Answers

I was facing a similar issue when I was trying to view the extent report from Jenkins.

Reason for this issue: The issue is because of the 'Content-Security-Policy' which is introduced in Jenkins from v1.641, It is blocking the inline CSS, JS Ajax resources to loaded

Solution: Change default Content Security Policy. Go to Manage Jenkins -> Script Console and type into console the following commands:

System.clearProperty("hudson.model.DirectoryBrowserSupport.CSP");

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "sandbox allow-scripts; default-src 'self'; script-src * 'unsafe-eval'; img-src *; style-src * 'unsafe-inline'; font-src *");

restart Jenkins after the above step

This worked for me :)

like image 130
Pranam Avatar answered Dec 31 '25 17:12

Pranam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!