getContexts method
Fetches information about active contexts associated with this extension
filter
A filter to find matching contexts. A context matches if it
matches all specified fields in the filter. Any unspecified field in the
filter matches all contexts.
returns
Invoked with the matching contexts, if any.
Implementation
Future<List<ExtensionContext>> getContexts(ContextFilter filter) async {
var $res = await promiseToFuture<JSArray>(
$js.chrome.runtime.getContexts(filter.toJS));
return $res.toDart
.cast<$js.ExtensionContext>()
.map((e) => ExtensionContext.fromJS(e))
.toList();
}