Search code examples
jquerygoogle-chromeuserscripts

User script directory in Google Chrome


When I follow a link to a user script in Google Chrome (for example, https://gist.github.com/raw/1107277/cacd006f78ae9e02bb10a173e30092b0b56fb5e9/answers-6825715.user.js), where does the script get stored? If I make changes and save, will the script be updated when I refresh?


Solution

  • By default the script gets stored in the Extensions folder at:

    Windows XP:
    C:\Documents and Settings\***{username}***\Local Settings\Application Data\Google\Chrome\User Data\Default
    
    Windows Vista:
    C:\Users\***{username}***\AppData\Local\Google\Chrome\User Data\Default
    
    Windows 7:
    C:\Users\***{username}***\AppData\Local\Google\Chrome\User Data\Default
    

    You can change the folder by running Chrome with the --user-data-dir= option.


    If you make changes to the script, they won't apply until the script is reloaded by Chrome.
    To reload a script, either restart Chrome, or navigate to chrome://extensions/ and do hit the Reload link, if it is available.

    If the Reload link is not available, hit Disable, then Enable for the changes to go into effect.
    Note that changing the script's @include, @exclude, or @match directives will do nothing on already installed scripts. The manifest.json file must be edited for that.

    See "Manually adding a Userscript to Google Chrome" for more information.