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

X-Userscript-Update http header #1824

Closed
cletusc opened this issue Nov 5, 2013 · 10 comments
Closed

X-Userscript-Update http header #1824

cletusc opened this issue Nov 5, 2013 · 10 comments
Milestone

Comments

@cletusc
Copy link
Contributor

cletusc commented Nov 5, 2013

Per this chat, is it possible to include a HTTP header that signifies that an update check is in fact an update check? Having it namespaced as X-Userscript-* would, I think, make it so any engine (Tampermonkey or others) could just implement the same header without any name changes.

This would allow sites to detect update checks, and to route to their own .meta.js routine without any special per-site rules to implement in GM.

I think sizzlemctwizzle was going to look into patching this, but I'm not sure, I'll link him here.

@sizzlemctwizzle
Copy link
Contributor

Something like this?

@cletusc
Copy link
Contributor Author

cletusc commented Nov 6, 2013

Yes that is exactly what I was talking about. As to what should be in that header (the userscript engine, last time checked, something else..?) might be up for discussion. As long as it is set on update checks, that's the main thing.

@arantius
Copy link
Collaborator

arantius commented Nov 6, 2013

Would it make sense to set the User-Agent header for all requests that the extension (rather than the browser itself) makes?

@cletusc
Copy link
Contributor Author

cletusc commented Nov 6, 2013

Yes that could be beneficial, but there should still be some separation between installs and update checks so that update checks could be routed to a .meta.js routine.

@arantius
Copy link
Collaborator

arantius commented Nov 6, 2013

Oh yeah =)

Pick (i.e. make up) a MIME type and use the Accept header to indicate the type of response we prefer?

@sizzlemctwizzle
Copy link
Contributor

Yeah, that probably makes more sense than using a custom header. text/x-userscript-meta?

@cletusc
Copy link
Contributor Author

cletusc commented Nov 6, 2013

Works for me! :)

arantius added a commit that referenced this issue Jan 29, 2014
Set headers on HTTP requests that GM originates.

Fixes #1824
@cletusc
Copy link
Contributor Author

cletusc commented Mar 14, 2014

@sizzlemctwizzle @JasonBarnabe Dunno where else to put this, but Tampermonkey has also implemented this. Good job gents 👍

@sizzlemctwizzle
Copy link
Contributor

Yeah, I found out here. He also let me know how to get @requires to cache with Tampermonkey (he literally used an express.js function), which I'll need when I implement hosting libraries on OpenUserJS.org.

@sizzlemctwizzle
Copy link
Contributor

Shall we try for a third? gera2ld/Violentmonkey#2

I would try NinjaKit, but it doesn't have an updater (os0x/NinjaKit#8).

Update: Violentmonkey now supports this feature.

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

No branches or pull requests

3 participants