getCurrent method

Future<Tab?> getCurrent()

Gets the tab that this script call is being made from. Returns undefined if called from a non-tab context (for example, a background page or popup view).

Implementation

Future<Tab?> getCurrent() async {
  var $res = await promiseToFuture<$js.Tab?>($js.chrome.tabs.getCurrent());
  return $res?.let(Tab.fromJS);
}