In a browser extension, this my ajax call
var xhr = new XMLHttpRequest();
xhr.open('GET', window.location.href, true);
xhr.responseType = "arraybuffer";
xhr.onload = function(event) {
alert(this.response);
};
I really do not understand why this giving me the error
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://people.cs.aau.dk/~torp/Teaching/E01/Oop/handouts/collections.pdf. (Reason: CORS header 'Access-Control-Allow-Origin' missing)
CORS comes into picture only once we are making the calls to other domain. But here I am making the call to the same domain. You can witness that in url xhr.open('GET', window.location.href, true);
What I am missing here ?