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

Request mode is "same-origin" but the URL's origin is not same as the request origin #1

Closed
Jaid opened this issue Feb 10, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@Jaid
Copy link

Jaid commented Feb 10, 2019

Thanks for releasing that userscript, looks great! I can't get it to work though.

Console error:

Fetch API cannot load https://api.github.com/repos/Jaid/array-to-object-keys/releases.
Request mode is "same-origin" but the URL's origin is not same as the request origin https://github.com.

Screenshot of the exception break in Developer Tools:

image

Screenshot of the security settings in my userscript manager:

image

Environment:

Linux 4.15.0-44-generic
Linux Mint 19.1 Cinnamon
Google Chrome 72.0.3626.96 (Official Build) (64-bit)
Tampermonkey 4.7.63

Am I doing something wrong?

3F added a commit that referenced this issue Feb 10, 2019
@3F
Copy link
Owner

3F commented Feb 10, 2019

Thanks for the report,

This error looks like because of default Tampermonkey features with cross-origin requests.
The same error for added Tampermonkey 4.8.5847 to Firefox 65.0 (I'm using this). But no problems when Greasemonkey 4.7.

But anyway, yes api.github.com it's really other domain to github.com for cors policy, so I changed mode to this.

Please check this out before release:

https://github.com/3F/GhrMeter.user.js/releases/tag/CI-build-20

@3F 3F added the bug Something isn't working label Feb 10, 2019
@Jaid
Copy link
Author

Jaid commented Feb 10, 2019

Thank you very much! Works fine with that patch. :)

image

@3F 3F closed this as completed in #2 Feb 10, 2019
3F added a commit that referenced this issue Feb 10, 2019
* FIXED: Possible "Request mode is "same-origin" but the URL's origin is not same as the request origin" #1
* NOTE: Tested via Firefox 65.0 + Greasemonkey 4.7
* NOTE: Tested via Firefox 65.0 + Tampermonkey 4.8.5847
* NOTE: Tested via Chrome 72.0.3626.96 + Tampermonkey 4.7.63 ( Thanks @Jaid )
@3F
Copy link
Owner

3F commented Feb 10, 2019

Just released 0.6.1. Enjoy.

* FIXED: Possible "Request mode is "same-origin" but the URL's origin is not same as the request origin" #1
* NOTE: Tested via Firefox 65.0 + Greasemonkey 4.7
* NOTE: Tested via Firefox 65.0 + Tampermonkey 4.8.5847
* NOTE: Tested via Chrome 72.0.3626.96 + Tampermonkey 4.7.63 ( Thanks @Jaid )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants