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

[htmlpublisher] Extract inline script block and event handler in htmlpublisher/HtmlPublisher/header.html

    • 1.37

      Problems

      == Inline Script Block
      Line: 90
      ----
      <script type="text/javascript">
      function updateBody(tabId, page) {
          document.getElementById(selectedTab).setAttribute("class", "unselected");
          tab = document.getElementById(tabId)
          tab.setAttribute("class", "selected");
          selectedTab = tabId;
          iframe = document.getElementById("myframe");
          iframe.src = encodeURIComponent(tab.getAttribute("value")).replace(/%2F/g, '/');
      }
      function init(tabId){
      	updateBody(tabId);
      }
      
      var selectedTab = "tab1"
      </script>
      ----
      
      == Inline Event Handler
      Line: 108
      ----
      <body onload="init('tab1');">
      ----
      

      Solutions

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

          [JENKINS-74015] [htmlpublisher] Extract inline script block and event handler in htmlpublisher/HtmlPublisher/header.html

          Basil Crow created issue -
          Basil Crow made changes -
          Assignee Original: Richard Bywater [ r2b2_nz ]
          Basil Crow made changes -
          Summary Original: [htmlpublisher] Extract inline script blocks and lsevent handlers in htmlpublisher/HtmlPublisher/header.html New: [htmlpublisher] Extract inline script blocks and event handlers in htmlpublisher/HtmlPublisher/header.html
          Basil Crow made changes -
          Description Original: h4. Problems

          {noformat}
          == Inline Script Block
          Line: 90
          ----
          <script type="text/javascript">
          function updateBody(tabId, page) {
              document.getElementById(selectedTab).setAttribute("class", "unselected");
              tab = document.getElementById(tabId)
              tab.setAttribute("class", "selected");
              selectedTab = tabId;
              iframe = document.getElementById("myframe");
              iframe.src = encodeURIComponent(tab.getAttribute("value")).replace(/%2F/g, '/');
          }
          function init(tabId){
          updateBody(tabId);
          }

          var selectedTab = "tab1"
          </script>
          ----

          == Inline Event Handler
          Line: 108
          ----
          <body onload="init('tab1');">
          ----

          == Inline Script Block
          Line: 90
          ----
          <script type="text/javascript">
          function updateBody(tabId, page) {
              document.getElementById(selectedTab).setAttribute("class", "unselected");
              tab = document.getElementById(tabId)
              tab.setAttribute("class", "selected");
              selectedTab = tabId;
              iframe = document.getElementById("myframe");
              iframe.src = encodeURIComponent(tab.getAttribute("value")).replace(/%2F/g, '/');
          }
          function init(tabId){
          updateBody(tabId);
          }

          var selectedTab = "tab1"
          </script>
          ----

          == Inline Event Handler
          Line: 108
          ----
          <body onload="init('tab1');">
          ----
          {noformat}

          h4. Solutions

          [https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks]
          [https://www.jenkins.io/doc/developer/security/csp/#inline-event-handlers]
          New: h4. Problems

          {noformat}
          == Inline Script Block
          Line: 90
          ----
          <script type="text/javascript">
          function updateBody(tabId, page) {
              document.getElementById(selectedTab).setAttribute("class", "unselected");
              tab = document.getElementById(tabId)
              tab.setAttribute("class", "selected");
              selectedTab = tabId;
              iframe = document.getElementById("myframe");
              iframe.src = encodeURIComponent(tab.getAttribute("value")).replace(/%2F/g, '/');
          }
          function init(tabId){
          updateBody(tabId);
          }

          var selectedTab = "tab1"
          </script>
          ----

          == Inline Event Handler
          Line: 108
          ----
          <body onload="init('tab1');">
          ----
          {noformat}

          h4. Solutions

          [https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks]
          [https://www.jenkins.io/doc/developer/security/csp/#inline-event-handlers]
          Summary Original: [htmlpublisher] Extract inline script blocks and event handlers in htmlpublisher/HtmlPublisher/header.html New: [htmlpublisher] Extract inline script block and event handler in htmlpublisher/HtmlPublisher/header.html
          Yaroslav Afenkin made changes -
          Assignee New: Yaroslav Afenkin [ yafenkin ]
          Yaroslav Afenkin made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Yaroslav Afenkin made changes -
          Remote Link New: This issue links to "jenkinsci/htmlpublisher-plugin/pull/312 (Web Link)" [ 30122 ]
          Yaroslav Afenkin made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Yaroslav Afenkin made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Fixed but Unreleased [ 10203 ]

          Basil Crow added a comment -

          Basil Crow added a comment - Fixed in jenkinsci/htmlpublisher-plugin#312 . Released in 1.37 .
          Basil Crow made changes -
          Released As New: 1.37
          Status Original: Fixed but Unreleased [ 10203 ] New: Closed [ 6 ]

            yafenkin Yaroslav Afenkin
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: