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 $js.chrome.tabs.getCurrent().toDart;
  return $res?.let(Tab.fromJS);
}