user6507641
user6507641

Reputation: 69

Prevent caching of @require'd files

I use @require to load a local JavaScript file shared by some of my GreaseMonkey scripts. When I change the file, GreaseMonkey continues to use the original version and does not load the new version. How can I disable the caching of the @required file?

Upvotes: 6

Views: 918

Answers (1)

double-beep
double-beep

Reputation: 5510

In TamperMonkey, file:// resources won't be cached. You should, however, enable access to file URLs at Chrome's extension management page:

Allow access to file URLs option

The are other ways to prevent caching of @required files (source):

  1. Increase the version number and save the script. All resources will be reloaded.
  2. Set "Config mode" to "Advanced" in the Setting tab. Scroll to "Externals" and set the "Update Interval" to "Always". "Always" means after the resource was used, so you might need to execute/load the page twice.
  3. You can edit the external resources using the "Edit" button.

Upvotes: 1

Related Questions