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

[piwikanalytics] Extract inline script block in hudson/plugins/piwik/PiwikAnalyticsPageDecorator/footer.jelly

XMLWordPrintable

      Problem

      == Inline Script Block
      Line: 5
      ----
      <script type="text/javascript">
                    var _paq = _paq || [];
                    _paq.push(["setDomains", ["*.localhost"]]);
                    _paq.push(['trackPageView']);
                    _paq.push(['enableLinkTracking']);
                    (function() {
                      var u="${it.protocolString}${it.piwikServer}${it.piwikPath}";
                      _paq.push(['setTrackerUrl', u+'piwik.php']);
                      _paq.push(['setSiteId', ${it.siteId}]);
                      <j:if test="${it.additionnalDownloadExtensions!=null}">
                          _paq.push(['setDownloadExtensions', "${it.additionnalDownloadExtensions}"]);
                      </j:if>
                      var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
                      g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
                    })();
                  </script>
      ----
      

      Solution

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

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

              Created:
              Updated: