-
Notifications
You must be signed in to change notification settings - Fork 56
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
Blocking webRequest usecase - GM_xmlhttpRequest for Tampermonkey/Violentmonkey userscripts #176
Comments
@tophf, I don't understand the association between request cookies and the user's main profile. To my knowledge Chrome's incognito implementation creates a temporary profile that's discarded when the incognito session ends. As such, there shouldn't be a need for user scripts to remove cookies from requests modification to remove main profile cookies from incognito requests. Am I missing something? |
Extensions in the default spanning mode for incognito use the same background script and the same cookie store as the main profile. Either way, the tracking problem is just one example. Userscripts also need to set/get a cookie explicitly just for a request, without affecting the main profile. Userscripts also often need to set Without a blocking webRequest we need another way to track the lifecycle of the request made via As I explained declarativeNetRequest can't be used now because we would have to allow just one request at a time in the entire browser to be able to track it reliably via the observational webRequest. Maybe it can be extended in the future e.g. by adding a condition for the request like Anyway, currently this is purely academic because ManifestV3 still doesn't have a solution for userscript extensions. |
Thanks for calling out spanning mode; that slipped my mind. My first impression is that it may be best for browsers to consider directly supporting more of |
Native support would be a nice feature, especially if the browser can show a native confirmation dialog for the URL per the satellite |
As a starting point allowing Another thing would be raw access to the received headers or even better a way to modify them before they are processed by the browser.
I think there a lot more extensions that modify their own request via webRequest to fit their needs. So I'd favor a more general solution, except this is what you mean with "support GM APIs". |
The deadline for manifest v3 has been determined. Is there still no solution to this problem? |
GM_xmlhttpRequest/GM.xmlHttpRequest is a foundational feature for userscripts.
It needs the ability to set custom HTTP headers from the "forbidden" list e.g. cookie-related headers to implement proper isolation of cookies in incognito mode, otherwise userscripts running there would enable passive tracking of the main profile.
The declarativeNetRequest API cannot be used because its rules cannot be scoped to an individual request, only to the entire tab, which may have a lot of frames and a lot of different userscripts making overlapped requests. Currently, a blocking webRequest is used by Tampermonkey/Violentmonkey to set a dummy temporary header (removed in onBeforeSendHeaders) with a random id that's used to map the request's id in further events.
The text was updated successfully, but these errors were encountered: