Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] disable cache of @require #2097

Closed
viocha opened this issue May 9, 2024 · 7 comments
Closed

[BUG] disable cache of @require #2097

viocha opened this issue May 9, 2024 · 7 comments
Labels

Comments

@viocha
Copy link

viocha commented May 9, 2024

Problem:

The required scripts nerver get updated to the latest version after the script was first installed. I can't find any way to update the required resources or disable the internal cache of violentmonkey.

I used the following code to declare the resouces from github.

// @require     https://raw.githubusercontent.com/.......

Expected result:

The script manager should check for updates of required resources periodically or provide one button to update mannually or provide one option to disable the cache.

Devtools console contents:

Environment:

  • OS: Windows
  • Browser: Chrome 123
  • Violentmonkey Version:
@viocha viocha added the bug label May 9, 2024
@tophf
Copy link
Member

tophf commented May 9, 2024

It should be fixed in beta, AFAIK. Can you try it?

@F9y4ng
Copy link

F9y4ng commented Sep 7, 2024

@tophf @derjanb

This problem exists not only on Violentmonkey, but also on Tampermonkey. When auto-updating scripts, if you encounter network issues (especially in mainland China), that cause @require content to not download successfully, there is no obvious way to re-download @require content. This will cause the code to report errors.

The only way to do this is to change the code version number, save it, and manually update it so that the VM or TM can re-update the code for @require to re-download.

@tophf
Copy link
Member

tophf commented Sep 7, 2024

@F9y4ng, does it help in Tampermonkey if you use Subresource Integrity hashes in the URL?

@tophf
Copy link
Member

tophf commented Sep 7, 2024

Oh and I guess it would make sense to add button in the dependency viewer in the editor to force an update...

@F9y4ng
Copy link

F9y4ng commented Sep 7, 2024

@F9y4ng, does it help in Tampermonkey if you use Subresource Integrity hashes in the URL?

No, I'm using Subresource Integrity hashes in my current code and it doesn't help the problem.

Oh and I guess it would make sense to add ⟳ button in the dependency viewer in the editor to force an update...

Will it be hidden too deep for users to find it?

The average script user can't even figure out what's causing the problem at all, just that the script is reporting an error. It would be nice if the @require failed process could be detected and the download retried automatically. If multiple attempts (such as 3 times) fail, the user will be prompted on the list page to manually update the @require resource.

@JourneyOver
Copy link

Wouldn't mind having a button of some kind to update the cache for the @require sources without actually having to edit the url in the @require. Tampermonkey does have a way to do this in it's extension that you can update/delete/edit the @require sources easily whenever you want --
image

@F9y4ng
Copy link

F9y4ng commented Sep 18, 2024

Wouldn't mind having a button of some kind to update the cache for the @require sources without actually having to edit the url in the @require. Tampermonkey does have a way to do this in it's extension that you can update/delete/edit the @require sources easily whenever you want --

No, if you encounter network issues when auto-updating scripts, @require content will not be downloaded successfully, and no buttons will appear at this time. Hopefully, you've encountered this issue and not just guesswork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants