Search code examples
javascriptdebuggingxmlhttprequestgoogle-chrome-devtools

Find the source of an XMLHttpRequest using Chrome/Firefox dev tools


I'm trying to debug a web application not written by me. There is a failing XMLHttpRequest being made:

XMLHttpRequest cannot load ... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '...' is therefore not allowed access. 

Is there a way, preferably using Chrome developer tools, to locate the source of this call?


Solution

  • It turns out - yes, there is. That "XHR Breakpoints" option on the side which I had always ignored:

    enter image description here

    It works perfectly.

    Firefox has an identical feature:

    enter image description here