Hi

      When clicking the link to view my HTML report 

      I get taken to my report page but no CSS is being rendered

      The CSS and JS for the page is in the head of the document.

      Would there be any obvious reason as to why the page is rendering this way?

      Thanks

          [JENKINS-50254] No CSS being rendered

          This sounds like Content Security Policy hasn't been configured as per https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy - are you able to give that a go and see if that fixes things? (Please note that it will only work on new HTML reports not previously created ones)

          Richard Bywater added a comment - This sounds like Content Security Policy hasn't been configured as per https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy  - are you able to give that a go and see if that fixes things? (Please note that it will only work on new HTML reports not previously created ones)

          Richard Lewis added a comment -

          Thanks, that has worked (Should have looked at that first, apologies), happy for this to be closed, thanks for the help

          Richard Lewis added a comment - Thanks, that has worked (Should have looked at that first, apologies), happy for this to be closed, thanks for the help

          All good - its sometimes hard to spot. This comes up quite a bit so was wondering if there is a particular place that you think it would have helped to have it pointed out clearly to make sure that you have the correct settings? (e.g. the Wiki page, the Github page, somewhere else?) 

          Richard Bywater added a comment - All good - its sometimes hard to spot. This comes up quite a bit so was wondering if there is a particular place that you think it would have helped to have it pointed out clearly to make sure that you have the correct settings? (e.g. the Wiki page, the Github page, somewhere else?) 

          Richard Lewis added a comment -

          I think (for me) there was a lot of information (slightly overwhelming) but probably necessary due to the possible consequences of making changes of this nature.

          In the end i found an answer on StackOverflow that pointed out that changes could be made directly in the Script Console setting 

          System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "default-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';")

          This was the only way i could get the inline scripts to run (not saying this is the best way mind)

          Richard Lewis added a comment - I think (for me) there was a lot of information (slightly overwhelming) but probably necessary due to the possible consequences of making changes of this nature. In the end i found an answer on StackOverflow that pointed out that changes could be made directly in the Script Console setting  System .setProperty( "hudson.model.DirectoryBrowserSupport.CSP" , " default -src 'self' 'unsafe-inline' ; style-src 'self' 'unsafe-inline' ;" ) This was the only way i could get the inline scripts to run (not saying this is the best way mind)

          Thanks - will continue to look at ways of making the CSP stuff a bit more visible to avoid this in the future but, in the meantime, glad to hear that you are all up and running.

          Richard Bywater added a comment - Thanks - will continue to look at ways of making the CSP stuff a bit more visible to avoid this in the future but, in the meantime, glad to hear that you are all up and running.

            r2b2_nz Richard Bywater
            richlewis14 Richard Lewis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: