2

I am getting a CORB error in Chrome Incognito mode while trying to load an external Javascript file to the DOM. Onething to note is CORS was enabled for this external JSfile and it's working in the normal mode.

Cross-Origin Read Blocking (CORB) blocked cross-origin response with MIME type text/html.

On Page load I am trying to add an external JS file to Dom using

script = docuemnt.createElement('script');
script.setAttribute('src', 'js-file.js');
document.head.appendChild(script);

Response from js-file.js was blocked in chrome incognito mode. Any help to resolve this issue is appreciated.

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
Kapil gopinath
  • 1,053
  • 1
  • 8
  • 18
  • Are you loading `js-file.js` from the same origin/domain as your website? Can you provide response headers for `js-file.js` load request? – farhodius Feb 07 '21 at 04:37
  • @farhodius: js-file.js is not from the same domain. For that purpose CORS was enabled. Response Headers HTTP/1.1 302 Found Date: Mon, 08 Feb 2021 15:05:12 GMT Server: Apache X-Frame-Options: SAMEORIGIN Cache-Control: no-store Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: text/html; charset=iso-8859-1 – Kapil gopinath Feb 08 '21 at 15:09
  • Do you have control over the server hosting your `js-file.js`? Some websites can detect if you are browsing in incognito mode and prevent you from reading their content. Does issue persist in Firefox incognito mode as well? – farhodius Feb 09 '21 at 04:17
  • @farhodius I dont have access to server. I didn't check firefox incognito. It's working fine in Edge private mode. – Kapil gopinath Feb 09 '21 at 17:46

0 Answers0