hasDocument method

Future<bool> hasDocument()

Determines whether the extension has an active document. TODO(https://crbug.com/1339382): This probably isn't something we want to ship in its current form (hence the nodoc). Instead of this, we should integrate offscreen documents into a service worker-compatible getViews() alternative. But this is pretty useful in testing environments. |callback|: Invoked with the result of whether the extension has an active offscreen document.

Implementation

Future<bool> hasDocument() async {
  var $res = await promiseToFuture<bool>($js.chrome.offscreen.hasDocument());
  return $res;
}