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

[cloudtest] Extract inline script block and event handler in com/soasta/jenkins/JunitResultAction/summary.jelly

      Problems

      == Inline Script Block
      Line: 7
      ----
      <script type="text/javascript">
      		function myshow(){
      			var oIfr = document.getElementById("ifr");
      			var oAid = document.getElementById("aid");
      			var oSerr = document.getElementById("serr");
      			
      			if (oIfr.style.display=="block" || oSerr.style.display=="block") {
      				oAid.innerHTML = "Click here to see the SOASTA CloudTest dashboard for this test";
      				oSerr.style.display="none";
      				oIfr.style.display="none";
      			} else {
      				try {
      					if (oIfr.contentDocument &amp;&amp; 
      						(!oIfr.contentDocument.body || !oIfr.contentDocument.body.innerHTML)) {
      						<!-- Mixed-content blocking message needed. -->
      						oAid.innerHTML = "SOASTA CloudTest dashboard for this test is currently unavailable";
      						oSerr.style.display="block";
      						oIfr.style.display="none";
      					}
      				} catch (e) {
      					<!-- A DOMException concerning "SecurityError" will be thrown if the iframe succeeded in loading. -->
      					oAid.innerHTML = "Click here to hide the SOASTA CloudTest dashboard";
      					oSerr.style.display="none";
      					oIfr.style.display="block";
      				}
      			}
      		}
         	</script>
      ----
      
      == Inline Event Handler
      Line: 140
      ----
      <a id="aid" href="#" onClick="myshow()">
      ----
      

      Solutions

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

          [JENKINS-74478] [cloudtest] Extract inline script block and event handler in com/soasta/jenkins/JunitResultAction/summary.jelly

          Basil Crow created issue -
          Basil Crow made changes -
          Description Original: h4. Problems

          {noformat}
          == Inline Event Handler
          Line: 140
          ----
          <a id="aid" href="#" onClick="myshow()">
          ----

          == Inline Script Block
          Line: 7
          ----
          <script type="text/javascript">
          function myshow(){
          var oIfr = document.getElementById("ifr");
          var oAid = document.getElementById("aid");
          var oSerr = document.getElementById("serr");

          if (oIfr.style.display=="block" || oSerr.style.display=="block") {
          oAid.innerHTML = "Click here to see the SOASTA CloudTest dashboard for this test";
          oSerr.style.display="none";
          oIfr.style.display="none";
          } else {
          try {
          if (oIfr.contentDocument &amp;&amp;
          (!oIfr.contentDocument.body || !oIfr.contentDocument.body.innerHTML)) {
          <!-- Mixed-content blocking message needed. -->
          oAid.innerHTML = "SOASTA CloudTest dashboard for this test is currently unavailable";
          oSerr.style.display="block";
          oIfr.style.display="none";
          }
          } catch (e) {
          <!-- A DOMException concerning "SecurityError" will be thrown if the iframe succeeded in loading. -->
          oAid.innerHTML = "Click here to hide the SOASTA CloudTest dashboard";
          oSerr.style.display="none";
          oIfr.style.display="block";
          }
          }
          }
              </script>
          ----

          == Inline Event Handler
          Line: 140
          ----
          <a id="aid" href="#" onClick="myshow()">
          ----

          == Inline Script Block
          Line: 7
          ----
          <script type="text/javascript">
          function myshow(){
          var oIfr = document.getElementById("ifr");
          var oAid = document.getElementById("aid");
          var oSerr = document.getElementById("serr");

          if (oIfr.style.display=="block" || oSerr.style.display=="block") {
          oAid.innerHTML = "Click here to see the SOASTA CloudTest dashboard for this test";
          oSerr.style.display="none";
          oIfr.style.display="none";
          } else {
          try {
          if (oIfr.contentDocument &amp;&amp;
          (!oIfr.contentDocument.body || !oIfr.contentDocument.body.innerHTML)) {
          <!-- Mixed-content blocking message needed. -->
          oAid.innerHTML = "SOASTA CloudTest dashboard for this test is currently unavailable";
          oSerr.style.display="block";
          oIfr.style.display="none";
          }
          } catch (e) {
          <!-- A DOMException concerning "SecurityError" will be thrown if the iframe succeeded in loading. -->
          oAid.innerHTML = "Click here to hide the SOASTA CloudTest dashboard";
          oSerr.style.display="none";
          oIfr.style.display="block";
          }
          }
          }
              </script>
          ----
          {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: 7
          ----
          <script type="text/javascript">
          function myshow(){
          var oIfr = document.getElementById("ifr");
          var oAid = document.getElementById("aid");
          var oSerr = document.getElementById("serr");

          if (oIfr.style.display=="block" || oSerr.style.display=="block") {
          oAid.innerHTML = "Click here to see the SOASTA CloudTest dashboard for this test";
          oSerr.style.display="none";
          oIfr.style.display="none";
          } else {
          try {
          if (oIfr.contentDocument &amp;&amp;
          (!oIfr.contentDocument.body || !oIfr.contentDocument.body.innerHTML)) {
          <!-- Mixed-content blocking message needed. -->
          oAid.innerHTML = "SOASTA CloudTest dashboard for this test is currently unavailable";
          oSerr.style.display="block";
          oIfr.style.display="none";
          }
          } catch (e) {
          <!-- A DOMException concerning "SecurityError" will be thrown if the iframe succeeded in loading. -->
          oAid.innerHTML = "Click here to hide the SOASTA CloudTest dashboard";
          oSerr.style.display="none";
          oIfr.style.display="block";
          }
          }
          }
              </script>
          ----

          == Inline Event Handler
          Line: 140
          ----
          <a id="aid" href="#" onClick="myshow()">
          ----
          {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: [cloudtest] Extract inline script blocks and event handlers in com/soasta/jenkins/JunitResultAction/summary.jelly New: [cloudtest] Extract inline script block and event handler in com/soasta/jenkins/JunitResultAction/summary.jelly

            Unassigned Unassigned
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: