Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-39799

Clicking Edit takes a long time to load the editor when custom javascript files are loaded via the html macro

    XMLWordPrintable

Details

    Description

      Summary

      When clicking Edit on a page in Confluence, if there is any javascript file loaded via the html macro, then it takes about 20 seconds before the editor is displayed. The problem appears to be caused by the Quick Edit Plugin in combination with compressing HTTP responses.

      Additional Note

      This issue affects the page load as well. Please refer to the following screencasts for detailed information.
      • Issue reproducible on Confluence 5.8.14 - Confluence-5.8.14-Reproducible.mp4
      • Issue non-reproducible on Confluence 5.7.5 - Confluence-5.7.5-Non-Reproducible.mp4

      Steps to Reproduce

      1. Enable the HTML macro as per the documentation
      2. Drop a javascript file (i.e. sample.js) into <confluence-install>/confluence/WEB-INF/includes/js
      3. Create a page
      4. Insert a HTML macro containing the below, with the context path and filename changed to match the real file (the problem does not reproduce if the file doesn't exist):
        <script type="text/javascript" src="/CONTEXT_PATH/includes/js/myjavascript.js"></script>
        
      5. Save the page
      6. Click "Edit"

      Expected Results

      The editor should show up almost instantly.

      Actual Results

      Edit shows a spinner for around 20 seconds before showing the editor.

      Workaround 1

      1. Go to "General Configuration" in Confluence Admin and disable "Compress HTTP Responses" this removes the slow page load effect.

      Workaround 2

      This workaround will disable the Quick Edit plugin for the page editor only automatically on page loads. This means you will not be able to use the keyboard shortcut "e" to edit pages, as a side effect. This corrects the Edit button slow loading.

      1. Go to "Custom HTML" in Confluence Administration
      2. Put the below code into the head section:
        <script>
        AJS.$(window).load(function(){
            AJS.Confluence.QuickEdit.QuickEditPage.disable();
        });
        </script>
        
      3. Save the changes

      Attachments

        1. access-page.har
          4.32 MB
        2. Confluence-5.7.5-Non-Reproducible.mp4
          1.51 MB
        3. Confluence-5.8.14-Reproducible.mp4
          1.93 MB
        4. reload-page.har
          4.25 MB
        5. sample.js
          0.2 kB
        6. save-page.har
          4.33 MB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dmason David Mason (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: