supportsCrossOrigin property

bool 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);
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-html/HttpRequest/supportsCrossOrigin.html