CSS formatting getting stripped out when viewing on jenkins

0 votes
I’m facing a weird problem with my Jenkins HTML publisher plugin. I have a report where I’ve done all fancy css formatting and I’m unable to view it on Jenkins. If I download the report on my local and view it, its seen perfectly fine(with all formatting).

How am I supposed to solve it.
Aug 14, 2018 in DevOps & Agile by Hannah
• 14,080 points
45 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

CSS is stripped out because of the Content Security Policy in Jenkins.

The default rule is set to:

sandbox; default-src 'none'; img-src 'self'; style-src 'self';

This rule set results in the following:

  • No JavaScript allowed at all
  • No plugins (object/embed) allowed
  • No inline CSS, or CSS from other sites allowed
  • No images from other sites allowed
  • No frames allowed
  • No web fonts allowed
  • No XHR/AJAX allowed, etc.

To relax this rule, go to Manage Jenkins->Script console and type in the following command:

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")

and Press Run. If you see the output as 'Result:' below "Result" header then the protection disabled. Re-Run your build and you can see that the new HTML files archived will have the CSS enabled.

answered Aug 14, 2018 by Kalgi
• 35,720 points

Related Questions In DevOps & Agile

0 votes
1 answer

What OS is Jenkins installed on Azure Virtual Machine?

Under Managed Jenkins there's a section called ...READ MORE

answered Apr 4, 2018 in DevOps & Agile by DareDev
• 6,520 points
24 views
0 votes
2 answers

Unable to use jenkins to run oracle script on remote DB

add ORACLE_HOME  in jenkins global variable. READ MORE

answered Mar 26 in DevOps & Agile by hal
799 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,100 points
56 views
+13 votes
2 answers
+6 votes
5 answers

can't remove SSIS variables using remove method on PowerShell

you're missing the additional $environment.Alter() after your ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by ajs3033
• 7,000 points
56 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.