Catching 'Blocked loading mixed active content' CORS error

Viewed 5757

In firefox, when javascript attempts to do a CORS request to a http server from a page that is hosted on https, it will throw an error:

Blocked loading mixed active content 

I would like to catch these errors, but I can't figure out how. E.g.I tried something like this with jQuery:

try {
  $.get("http://public.opencpu.org/ocpu/library/").fail(function(xhr, err){
    console.log("Server error:" + xhr.responseText);
  });
} catch(e){
  console.log(e.message);;
}

But buth xhr.responseText and e.message are empty strings (probably because $.ajax happens asynchronously). How can I catch the actual error message that says: Blocked loading mixed active content...

2 Answers
Related