12

I am using the Application Insights JavaScript SDK on my website and Firefox is blocking the requests back to Azure. It is however working on Chrome.

The website is running on https and Application Insights works correctly on Chrome.

On the Console in Firefox I see the following warning: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://dc.services.visualstudio.com/v2/track. (Reason: CORS request did not succeed).

Why is Firefox identifying the request as a blocked CORS request, but Chrome doesn't?

I would like the Application Insights request to succeed from Firefox as well.

Steve
  • 121
  • 1
  • 4
  • Are you logged into azure on both browsers? Does the loaded resource have the same headers in the two browsers? – Bergi Sep 06 '19 at 12:15
  • No, since a typical user of the site won't be logged into Azure I am not logging into Azure on either browser. I am investigating the headers.... – Steve Sep 13 '19 at 05:34

2 Answers2

15

Did you installed an ad blocker extension (i.e. uBlock origin)? If yes, try to disable it.

Elgolfin
  • 151
  • 1
  • 3
1

Couple of points to look at:

  • Which version are you using for AI. Try upgrading your package to latest one:

  • You can go ahead try adding the site to exception and see if it works, it could be because of the firefox exception too:

Firefox 'Cross-Origin Request Blocked' despite headers

  • Last and most importantly check the headers as mentioned by @Bergi in the comment to see if headers are same for both browser.

Additional reference: https://github.com/Microsoft/ApplicationInsights-node.js/issues/133

http://testingfreak.com/how-to-fix-cross-origin-request-security-cors-error-in-firefox-chrome-and-ie/

Hope it helps.

Mohit Verma
  • 5,140
  • 2
  • 12
  • 27
  • The weird thing is I can't see any network activity from Firefox to AppInsights (not even an OPTIONS), only from Chrome. On Firefox I just see the message in the console `Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://dc.services.visualstudio.com/v2/track. (Reason: CORS request did not succeed).` – Steve Sep 13 '19 at 05:40