supportsCrossOrigin property

bool get supportsCrossOrigin

Checks to see if the current platform supports making cross origin requests.

Note that even if cross origin requests are supported, they still may fail if the destination server does not support CORS requests.

Implementation

static bool get supportsCrossOrigin {
  var xhr = new HttpRequest();
  return JS('bool', '("withCredentials" in #)', xhr);
}