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

[cavisson-ns-nd-integration] Extract inline script block and event handlers in com/cavisson/jenkins/BuildActionStopTest/index.jelly

XMLWordPrintable

      Note

      While testing this plugin, evaluate whether the third-party libraries in src/main/webapp are compatible with CSP in restrictive mode. The plugin may need to be upgraded from jQuery 1.x to 3.x to fully function in CSP restrictive mode.

      Problems

      == Inline Script Block
      Line: 22
      ----
      <script>
       		function stopTest(value){
       			if(value == 1){
       			document.getElementById('msg').style.display = "block";
       			instance.stopRunningTest(function(t) {
       				var res = t.responseObject();
       				document.getElementById('msg').style.display = "none";
       				alert(res);
      				window.history.back();
       			});
       			}else if(value == 0){
       				window.history.back();
       			}
       		}
       	</script>
      ----
      
      == Inline Event Handler
      Line: 9
      ----
      <span onclick="stopTest(1)">
      ----
      
      == Inline Event Handler
      Line: 13
      ----
      <span onclick="stopTest(0)">
      ----
      

      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: