I’ve got some code that does an ajax request using jQuery, and handles success and error conditions. On an error, I want to find out what the URL I called was, so I can log it. This information appears to be contained in the XMLHttpRequest.channel, but firefox is complaining about accessing this –
Permission denied for <http://localhost:8081> to get property XMLHttpRequest.channel
Any ideas how I can determine the URL associated with an XMLHttpRequest? What’s the security issue getting hold of this information? Cheers,
Colin
The security issue is cross domain XHR requests.
In FF2 you used to be able to override this in
about:config, also see this blog and especially this preference:But that’s all not possible anymore in FF3. And with a good reason.
Note that
XMLHttpRequest.channelis Gecko-specific, so this wouldn’t have worked in non-Gecko browsers.