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

GM.xmlhttpRequest not sending 'Referer' header like GM_xmlhttpRequest #2950

Closed
mt025 opened this issue May 10, 2018 · 3 comments
Closed

GM.xmlhttpRequest not sending 'Referer' header like GM_xmlhttpRequest #2950

mt025 opened this issue May 10, 2018 · 3 comments
Labels
bankruptcy Issues that have been closed for "bug bankruptcy". Usually very old non-active issues.
Milestone

Comments

@mt025
Copy link

mt025 commented May 10, 2018

It would be good to include the Referer header as a default, by getting the URL of the current page. Just like with cookies. I was wondering for a long time why my request was not working as it did in the old version, and the JS console.

It was a POST request that required the referer header to be set to the current page I was on, presumably to stop requests from other pages.

@mt025 mt025 changed the title GM.xmlhttpRequest not sending 'Referer' header like GM_xmlhttpRequest did GM.xmlhttpRequest not sending 'Referer' header like GM_xmlhttpRequest May 10, 2018
@NoneGiven
Copy link
Contributor

Makes sense to do this automatically for same-origin requests, matching the behavior of both GM_xmlhttpRequest and normal XHR. For cross-origin, the user can manually specify the referrer they want.

@prednaz
Copy link

prednaz commented Sep 10, 2018

GM.xmlhttpRequest does match the behavior of normal XHR. Neither of them sends a referer breaking my code which works in tampermonkey.

@prednaz
Copy link

prednaz commented Sep 10, 2018

And are you sure GM_xmlhttpRequest would send a referer? I have not yet checked the latest greasemonkey version including GM_xmlhttpRequest but by the last comment on https://greasyfork.org/en/forum/discussion/6928/gm-xmlhttprequest-vs-xmlhttprequest it was not the case in 2015.

@arantius arantius added this to the Features milestone Sep 11, 2018
@arantius arantius added the bankruptcy Issues that have been closed for "bug bankruptcy". Usually very old non-active issues. label Nov 2, 2023
@arantius arantius closed this as completed Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bankruptcy Issues that have been closed for "bug bankruptcy". Usually very old non-active issues.
Projects
None yet
Development

No branches or pull requests

4 participants