Skip to content

Overriding javascript files for QA testing

Code Hugger (Matthew Jones) edited this page Oct 26, 2019 · 2 revisions

Some issues (like adjusting CKEditor settings) require overriding Javascript to test certain settings.

For instance to test out the Autosave plugin, you might not want to have to wait 2 minutes, instead maybe 5-10 seconds. This can be done pretty easily now (in Chrome) without changing code on the server! These instructions are about changing CKEditor values but you can change any script or css.

  1. Navigate to the instance you want to test
  2. Go to More Tools -> Developer Tools in the Chrome menu so it displays the typical Dev Panel
  3. Click the Sources tab, Click Overrides, Click "Select folder for Overrides".
  4. Create a new folder or choose one you can use for override files. Select this folder.
  5. A popup warning will appear on the top of the page, select "Allow". Note, enable local overrides becomes checked.
  6. Click the Network tab
  7. Navigate to any page that has CKEditor
  8. On the filter box enter "ckeditor.launch.js"
  9. Right click on any of these files and select "Save for overrides"

Now you can modify this file in the editor here. Change something (like add console.log("HI") to the top and press Ctrl-S)

Reloading the page and looking at the Console tab you'll see your message.

To change the timeout for Autosave, search for autosave and change the delay from delay: 120 to delay: 5

Remember when you're done testing disable the local overrides checkbox or delete the files.

See for more information: https://developers.google.com/web/updates/2018/01/devtools#overrides