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

CORB problem in Chrome and in near time in Firefox too #108

Open
lleiton opened this issue Oct 14, 2020 · 6 comments
Open

CORB problem in Chrome and in near time in Firefox too #108

lleiton opened this issue Oct 14, 2020 · 6 comments

Comments

@lleiton
Copy link

lleiton commented Oct 14, 2020

I add a project in a website, but have a problem with CORB actually only in Chrome but in near time Firefox show information adding this control to.

https://www.chromestatus.com/feature/5629709824032768

You know how can i fix this in an openpixel code ?

Thanks in advance !

Luis

@stuyam
Copy link
Contributor

stuyam commented Oct 16, 2020

Would you mind sharing a screenshot of the errors you are seeing in the Chrome console or more providing some more information about what is happening?

@hashiranwaar
Copy link

Screen Shot 2020-11-11 at 11 30 46 AM
Everything works fine if i add header('Access-Control-Allow-Origin: DOMAIN_NAME_HERE'); in my .php file where i am inserting data in my db... if i dont put header() then i get CORS error as defined in image attached...

@stuyam
Copy link
Contributor

stuyam commented Nov 12, 2020

I really don't know enough about this stuff but I wish I did. Is it because Chrome now gives the same CORS rules to sendBeacon? Should we just use the img tag insert strategy for all browsers regardless of it they support sendBeacon or not? Some more details from the codebase of how we send events: https://github.com/dockwa/openpixel/blob/master/src/pixel.js#L56

@hsynlms
Copy link
Contributor

hsynlms commented Nov 12, 2020

As documented below CORB has no impact on beacon requests. I created a simple express server and sent a beacon request to it via ngrok (I made the endpoint be globally available) and seems it's working fine.

https://chromium.googlesource.com/chromium/src/+/master/services/network/cross_origin_read_blocking_explainer.md

The problem may be related to your backend and/or server configuration(s). It would be great to have a simple backend project with the same configuration to be able to do some tests and reproduce the case on our local machines.

@django23
Copy link

I think the issue here lays more in the HTTPS requests from a HTTP host. Make sure both hosts have the same protocol.

@lleiton
Copy link
Author

lleiton commented Jan 22, 2021

Hi django23! that's the problem
We tried to change beacom () to fetch () and we managed to eliminate the CORB error, but we have problems with the close () event and this information is necessary.
Function:
fetch(this.getSourceUrl(),
Headers:
headers: {
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8",
"Cross-Origin-Resource-Policy": "cross-origin"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants