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

Extract inline script blocks and event handlers

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • robot-plugin
    • 5.0.0

      Collection of automatically reported issues so we can handle them as one.

      Jenkins is starting require that plugins do not use in-line Javascript. 

       

      hudson/plugins/robot/RobotProjectAction/floatingBox.jelly:

      == Inline Event Handler
      Line: 28
      ----
      <input type="checkbox" id="zoomToChanges" onclick="redrawPassFailGraph('${from.urlName}/');"/>
      ----
      
      == Inline Event Handler
      Line: 29
      ----
      <input type="checkbox" id="failedOnly" onclick="redrawPassFailGraph('${from.urlName}/');"/>
      ----
      
      == Inline Event Handler
      Line: 30
      ----
      <input type="checkbox" id="criticalOnly" onclick="redrawPassFailGraph('${from.urlName}/');"/>
      ----
      
      == Inline Event Handler
      Line: 31
      ----
      <input min="0" max="9999" step="1" placeholder="all" value="" type="number" id="maxBuildsToShow" onchange="redrawPassFailGraph('${from.urlName}/');"/>
      ----
      
      == Inline Script Block
      Line: 34
      ----
      <script>initPassFailGraph('${from.urlName}/');</script>
      ----
      

      hudson/plugins/robot/model/RobotSuiteResult/index.jelly:

      == Inline Event Handler
      Line: 62
      ----
      <input type="checkbox" id="zoomToChanges" onclick="redrawPassFailGraph('');"/>
      ----
      
      == Inline Event Handler
      Line: 63
      ----
      <input type="checkbox" id="failedOnly" onclick="redrawPassFailGraph('');"/>
      ----
      
      == Inline Event Handler
      Line: 64
      ----
      <input type="checkbox" id="criticalOnly" onclick="redrawPassFailGraph('');"/>
      ----
      
      == Inline Event Handler
      Line: 65
      ----
      <input min="0" step="1" max="9999" value="" placeholder="all" type="number" id="maxBuildsToShow"
                               onchange="redrawPassFailGraph(''); redrawDurationGraph('');"/>
      ----
      
      == Inline Script Block
      Line: 69
      ----
      <script>initPassFailGraph('');</script>
      ----
      
      == Inline Script Block
      Line: 79
      ----
      <script>initDurationGraph('');</script>
      ----
      

      hudson/plugins/robot/model/RobotResult/index.jelly:

      == Inline Event Handler
      Line: 61
      ----
      <input type="checkbox" id="zoomToChanges" onclick="redrawPassFailGraph('');"/>
      ----
      
      == Inline Event Handler
      Line: 62
      ----
      <input type="checkbox" id="failedOnly" onclick="redrawPassFailGraph('');"/>
      ----
      
      == Inline Event Handler
      Line: 63
      ----
      <input type="checkbox" id="criticalOnly" onclick="redrawPassFailGraph('');"/>
      ----
      
      == Inline Event Handler
      Line: 64
      ----
      <input min="0" max="9999" step="1" placeholder="all" value="" type="number" id="maxBuildsToShow"
                               onchange="redrawPassFailGraph(''); redrawDurationGraph('');"/>
      ----
      
      == Inline Script Block
      Line: 68
      ----
      <script>initPassFailGraph('');</script>
      ----
      
      == Inline Script Block
      Line: 76
      ----
      <script>initDurationGraph('');</script>
      ----
      

      hudson/plugins/robot/model/RobotCaseResult/index.jelly:

      == Inline Event Handler
      Line: 57
      ----
      <input min="0" step="1" max="9999" value="" placeholder="all" type="number" id="maxBuildsToShow"
                               onchange="redrawPassFailGraph(''); redrawDurationGraph('');"/>
      ----
      
      == Inline Script Block
      Line: 61
      ----
      <script>initPassFailGraph('');</script>
      ----
      
      == Inline Script Block
      Line: 69
      ----
      <script>initDurationGraph('');</script>
      ----
      

      hudson/plugins/robot/util/failedCases.jelly:

      == Inline Event Handler
      Line: 24
      ----
      <a id="${escapedName}-showlink" href="#" onclick="javascript:showStackTrace('${h.jsStringEscape(escapedName)}','${h.jsStringEscape(relativeId)}/summary')" class="expand">
      ----
      
      == Inline Event Handler
      Line: 25
      ----
      <a id="${escapedName}-hidelink" href="#" onclick="javascript:hideStackTrace('${h.jsStringEscape(escapedName)}')" style="display:none" class="collapse">
      ----
      

      Solutions

      https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks
      https://www.jenkins.io/doc/developer/security/csp/#inline-event-handlers

            aleksisimell Aleksi Simell
            tattoo Tatu Kairi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: