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.
Something like this?
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.
Would it make sense to set the User-Agent header for all requests that the extension (rather than the browser itself) makes?
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.
Oh yeah =)
Pick (i.e. make up) a MIME type and use the Accept header to indicate the type of response we prefer?
Yeah, that probably makes more sense than using a custom header. text/x-userscript-meta?
Works for me! :)
Set the Accept header to let the server know we want a user script me…
…tadata block. Closes #1824.
@sizzlemctwizzle @JasonBarnabe Dunno where else to put this, but Tampermonkey has also implemented this. Good job gents 👍
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.
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.