GT2/GT2-Android/node_modules/auth0-js/lib/use_jsonp.js

27 lines
514 B
JavaScript
Raw Normal View History

/**
* Expose `use_jsonp`
*/
module.exports = use_jsonp;
/**
* Return true if `jsonp` is required
*
* @return {Boolean}
* @public
*/
function use_jsonp() {
var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : null;
if (xhr && 'withCredentials' in xhr) {
return false;
}
// We no longer support XDomainRequest for IE8 and IE9 for CORS because it has many quirks.
// if ('XDomainRequest' in window && window.location.protocol === 'https:') {
// return false;
// }
return true;
}