Creating & Debugging (Greasemonkey) User Scripts in Google Chrome

WARNING: These steps were written many years ago. The information may be out of date now.

Just a few quick tips for editing and debugging user scripts (a.k.a. Greasemonkey scripts) in Google Chrome.

    • Create your initial script, ensuring it is named MYSCRIPTNAME.user.js
    • Drag script onto Chrome window and choose to install
    • JS Script will be installed into Chrome settings directory. In Windows 7 this is:
    • C:\Users\XXXXXX\appdata\Local\Google\Chrome\User Data\Default\Extensions\xxxxxxxxxxxxxxxxxxxxx\1.0_0
    • Edit & work on the script.js inside this folder
    • To get Chrome to recognise your changes to the script, open the Extensions page, locate your extension and click 'Disable' and then 'Enable'
    • Note: if you change the URLs for which the extension is to be run, you need to completely uninstall your extension (or you might just be able to modify the manifest.json file). Just be careful to backup your script before you uninstall it, otherwise it may be deleted.
    • Use the Google Chrome developer tools to inspect elements, javascript attributes and to execute one or more lines of code to test live. (Right-click any page element and choose 'Inspect Element'.)