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

[Safari] GM_xmlhttpRequest does not use browser cookie? #786

Closed
robbielj opened this issue Oct 19, 2019 · 10 comments
Closed

[Safari] GM_xmlhttpRequest does not use browser cookie? #786

robbielj opened this issue Oct 19, 2019 · 10 comments

Comments

@robbielj
Copy link

robbielj commented Oct 19, 2019

Specifications

  • Safari: 13.0.2
  • TM: 4.9.6055
  • OS: mac os 10.15

I have observed that tampermonkey has a separated process (Tampermonkey (Safari)) for sending out requests. User agents differ from Safari as well. This is the reason why requests do not embed browser cookie anymore like before.

I tried setting headers for GM_xmlhttpRequest to include cookie however request cannot even be sent. Not sure whether this is fixable or there is some workaround.

@derjanb derjanb changed the title GM_xmlhttpRequest does not use browser cookie for Safari 13? [Safari] GM_xmlhttpRequest does not use browser cookie? Oct 19, 2019
@derjanb
Copy link
Member

derjanb commented Dec 12, 2019

4.10.6103 should fix setting headers of GM_xmlhttpRequest

@derjanb derjanb added the bug label Dec 12, 2019
@machsix
Copy link

machsix commented Dec 18, 2019

Firefox has similar issue. Hope it can be fixed in the next release.

@ivysrono
Copy link

Firefox has similar issue. Hope it can be fixed in the next release.

+1

@derjanb
Copy link
Member

derjanb commented Jan 20, 2020

@ivysrono @machsix This is issue is in no way related to Firefox, because there are major architectural differences.
If you can reproduce your issue at Tampermonkey Firefox BETA (#816) then please create a new issue and attach a script to reproduce the issue. Thanks.

@qsniyg
Copy link

qsniyg commented Apr 16, 2020

@derjanb I can still replicate the issue with the current beta (4.10.6112) under Firefox. If needed, I'll try to create an example test case (I'll have to find a test website that'll properly work with cookies), but the issue is that cookies aren't sent for websites that need them (in my case, Instagram), with GM_xmlhttpRequest.

@derjanb
Copy link
Member

derjanb commented Apr 16, 2020

@qsniyg This issue is special to Safari (which has no version 4.10.6112). So please create a new issue. A example test case would be great. Thanks.

@isokaze04
Copy link

Not fixed?
GM_xmlhttpRequest does not attach cookie still.

@Purfview
Copy link

@derjanb As I understand it's because Safari APIs and there is no workaround?

I don't have Mac, but one user reported that cookies are not sent on:

  • Safari: 15.0
  • TM: 4.13.6140

@amorphobia
Copy link

The issue still exists.

  • Safari: 15.6.1
  • TM: 4.17.6162

amorphobia added a commit to amorphobia/pt-helper that referenced this issue Mar 3, 2023
Safari on Mac does not use browser's cookie when calling
GM_xmlhttpRequest (see Tampermonkey/tampermonkey#786).

When user is not logged in, Nanyangpt will redirect to non-https
log-in page, which causes a cross origin request and user will get
a warnning.

For now, exclude tampermonkey on Mac to make the request. If
other browsers are affected, exclude them also.
@derjanb
Copy link
Member

derjanb commented Dec 1, 2024

Unfortunately this can't be fixed using Safari's App technology. However, there now is a new extension that uses Web Extension technology.

You can upgrade your extension by getting the Tampermonkey bundle.

@derjanb derjanb closed this as not planned Won't fix, can't repro, duplicate, stale Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants