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

Implement getResourceURL, getResourceText, @resource #224

Open
quoid opened this issue Feb 2, 2022 · 14 comments
Open

Implement getResourceURL, getResourceText, @resource #224

quoid opened this issue Feb 2, 2022 · 14 comments
Labels
discussion Any question, feedback or general comment enhancement Feature work

Comments

@quoid
Copy link
Owner

quoid commented Feb 2, 2022

No description provided.

@quoid quoid added discussion Any question, feedback or general comment javascript enhancement Feature work labels Feb 2, 2022
@stevehartwell
Copy link

Here's another userscript that has a dependency on GM_getResourceText:
Feedly Filtering and Sorting

It might be helpful in validating your implementation, whenever you get around to it.

More info at author's github page

Thanks for a very nice Safari extension!

@onatbas
Copy link

onatbas commented Mar 21, 2022

I was looking for this exactly. I have many scripts that rely on something like this:

// @grant GM_getResourceText
// @resource bla https://blabla

In addition, in contrast to tampermonkey and other script managers, it would be cool if the default cache behaviour is no-cache.

Thank you!

@quoid
Copy link
Owner Author

quoid commented Mar 22, 2022

@onatbas this will be in the next api update which should happen soonish

In addition, in contrast to tampermonkey and other script managers, it would be cool if the default cache behaviour is no-cache.

Can you elaborate on this?

The current plan is to implement this in a way that is similar to Greasemonkey and Violentmonkey.

This will probably function in a similar way as @require. That means the resource is download once on save. If the value changes for the key the resource will be re-downloaded. Resources are saved on the filesystem within the app's Data folder. They are not checked for updates.

I should also note, the exact way this would be implemented is not fully realized, so I am open to suggestions.

@onatbas
Copy link

onatbas commented Mar 22, 2022

In Tampermonkey settings, under the "Externals" section, it'll let you choose the update interval for the external resources. You can set it to "Always," which means downloading a fresh copy of external resources every time, without needing any change in the key whatsoever. By default, this setting is set to "Every Day" in Tampermonkey, but I use it in "Always" mode to get a fresh copy.

@michael1900
Copy link

HI, more or less, when getResourceURL and getResourceText will be implemented?

@quoid
Copy link
Owner Author

quoid commented Oct 16, 2022

@michael1900 any time estimate I give would be arbitrary, all I can say is that it is not in active development by any of the contributors that I am aware of. I do not think it should be done before #331 as I believe this API would rely on the manifest

@michael1900

This comment was marked as off-topic.

@quoid
Copy link
Owner Author

quoid commented Nov 30, 2022

@michael1900

I can not tell when this will get worked on.

Please remember, this is an open source project. We work on it in our spare time. Anyone (including you) are welcome to contribute, especially if you feel the passionately about a feature.

@michael1900

This comment was marked as off-topic.

@ACTCD
Copy link
Collaborator

ACTCD commented Mar 20, 2023

For those who are looking forward to this API, this will be implemented after #451 is completed, thanks for your patience.

@michael1900

This comment was marked as off-topic.

@quoid
Copy link
Owner Author

quoid commented Sep 13, 2023

Feel free to make a pull request @michael1900

@ACTCD
Copy link
Collaborator

ACTCD commented Oct 10, 2023

It looks like Greasemonkey haven't implement getResourceText in the new async APIs.

So if we're not going to implement the old Synchronous APIs #189, we'll probably just implement GM.getResourceUrl.

@michael1900

This comment was marked as off-topic.

@ACTCD ACTCD added this to Tasks Aug 19, 2024
@ACTCD ACTCD moved this to In progress in Tasks Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Any question, feedback or general comment enhancement Feature work
Projects
Status: In progress
Development

No branches or pull requests

5 participants