X-Userscript-Update http header #1824

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

Projects

None yet

3 participants

@cletusc
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
Contributor

Something like this?

@cletusc
Contributor
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
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
Contributor
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
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
Contributor

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

@cletusc
Contributor
cletusc commented Nov 6, 2013

Works for me! :)

@arantius arantius closed this in 5d1f10f Jan 29, 2014
@cletusc
Contributor
cletusc commented Mar 14, 2014

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

@sizzlemctwizzle
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 sizzlemctwizzle referenced this issue in violentmonkey/violentmonkey Mar 14, 2014
Closed

Set Accept header when checking for updates #2

@sizzlemctwizzle
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