Ajax: How to know if a user script implementation doesn't set the Origin header?
问题 Some user script implementations (like Google Chrome) allow direct cross AJAX requests, but some others don't, and use Same Origin Policy restrictions. Here's a part of code: /* * Get the size of the file. * @Button the current button for downloading the video. * @Url the http url of the video. */ function SetFileSize(Button, Url) { var ajax = new XMLHttpRequest(); ajax.onloadend = function () { GetResolution(Button, Url, ' - ' + (parseInt(this.getResponseHeader("Content-Length")) / 1048576)