Some JavaScripts do not work on Chrome after saving, although it is working upon previewing or refreshing the page. Some simple JS would work, but those that include JS functions won't work.

      Steps to reproduce

      1. Make you sure you enable the HTML macro
      2. Create a new page and insert HTML macro
      3. Add the following code in the macro:
        <script type="text/javascript">function displayDate() { document.getElementById("demo").innerHTML=Date(); }</script>
        
        <p id="demo">This is a paragraph.</p> <button type="button" onclick="displayDate()">Display Date</button>
      4. Save the page
      5. Click on "Display Date" button and nothing is displayed

      NOTE: In the Chrome console (F12), the following error is displayed: "Refused to execute a JavaScript script. Source code of script found within request." This error does not occur when you refresh the page.

      Workaround
      Refresh the page and the JavaScript will execute!

            [CONFSERVER-25935] Some JavaScripts do not work in Chrome after saving

            AmaliaA added a comment -

            Hi Steve. Thanks for the explanation I'll inform the customer about that.

            AmaliaA added a comment - Hi Steve. Thanks for the explanation I'll inform the customer about that.

            Hi Amalia

            Thanks for raising this issues. Unfortunately this is a security measure put in place by chrome browser and not something that we control. You can read more about this here:

            http://blog.chromium.org/2010/01/security-in-depth-new-security-features.html

            http://stackoverflow.com/questions/1547884/refused-to-execute-a-javascript-script-source-code-of-script-found-within-reque

            Steve Haffenden (Inactive) added a comment - Hi Amalia Thanks for raising this issues. Unfortunately this is a security measure put in place by chrome browser and not something that we control. You can read more about this here: http://blog.chromium.org/2010/01/security-in-depth-new-security-features.html http://stackoverflow.com/questions/1547884/refused-to-execute-a-javascript-script-source-code-of-script-found-within-reque

              Unassigned Unassigned
              asanusi AmaliaA
              Affected customers:
              0 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: