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

XMLWordPrintable

      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

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

              Created:
              Updated: