Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-32050

HTML publisher 1.10 does not execute javascript since Jenkins 1.625.3

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • htmlpublisher-plugin
    • None
    • Jenkins 1.625.3 LTS
      HTML publisher 1.10

      Since updating from 1.625.2 LTS to 1.625.3 LTS, javascript embedded within HTML published with the HTML publisher plugin does not seem to execute anymore.

      For example if I have the following HTML file:

      <html>
        <body>
        <h1>Test Results</h1>
        <script type="text/javascript" src="test.js"></script>
        </body>
      </html>
      

      and test.js contains:

      document.write('<h2>Summary</h2>');
      

      The published webpage only shows "Test Results" whereas it should show:
      Test Results
      Summary

          [JENKINS-32050] HTML publisher 1.10 does not execute javascript since Jenkins 1.625.3

          Bruno Lavit added a comment -

          With Jenkins LTS 1.625.3, there is a default rules set that prevent Javascript execution.
          If you want to relax these rules, please have a look here:
          https://wiki.jenkins-ci.org/display/JENKINS/Configuring+Content+Security+Policy
          Please tell us if it solves your problem.

          Bruno Lavit added a comment - With Jenkins LTS 1.625.3, there is a default rules set that prevent Javascript execution. If you want to relax these rules, please have a look here: https://wiki.jenkins-ci.org/display/JENKINS/Configuring+Content+Security+Policy Please tell us if it solves your problem.

          Thanks Bruno this solves my problem. Resolving.

          Adrien Le Masle added a comment - Thanks Bruno this solves my problem. Resolving.

          mcrooney added a comment -

          This is actually a valid bug in HTML Publisher, though see https://github.com/jenkinsci/htmlpublisher-plugin/pull/22 for that

          mcrooney added a comment - This is actually a valid bug in HTML Publisher, though see https://github.com/jenkinsci/htmlpublisher-plugin/pull/22 for that

          mcrooney added a comment -

          mcrooney added a comment - Duplicate of https://issues.jenkins-ci.org/browse/JENKINS-32026

            mcrooney mcrooney
            adrienlemasle Adrien Le Masle
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: