braintree / braintree-web-drop-in

Braintree Drop-in for the web
MIT License
200 stars 127 forks source link

Load third-party scripts with CORS support #865

Closed psyklopz closed 1 year ago

psyklopz commented 1 year ago

Load data-collector with CORS support for crash reporting Load PayPal checkout with CORS support for crash reporting Load Google Pay with CORS support for crash reporting

Summary

We've been chasing an issue where Google's pay.js throws an error for certain users. However, our crash reporting software does not have access to the stack trace as it's blocked by the CORS policy.

Rather than having to rebuild and host our own version of braintree-web-drop-in with every update we'd love it if this could be included by default. I think it adds value for other users who are in a similar situation and monitor their website's performance with a crash reporting tool.

The Braintree asset-loader project already supports setting the crossorigin='anonymous' attribute on the inserted script tag, this PR just updates the braintree-web-drop-in to pass the appropriate parameter to the call.

I'm open to feedback and willing to adjust this pull request if desired.

Checklist

Authors

ibooker commented 1 year ago

We're currently looking into this issue.

ibooker commented 1 year ago

@psyklopz Have you successfully tested with these changes? Based on our testing, it appears that the pay.google.com domain does not support CORS.

nidhinarendra commented 1 year ago

Since we have not got any response, we are closing this request. If you have any questions later please reach out to us.