getSessionRules method

Future<List<Rule>> getSessionRules(
  1. GetRulesFilter? filter
)

Returns the current set of session scoped rules for the extension. Callers can optionally filter the list of fetched rules by specifying a filter. |filter|: An object to filter the list of fetched rules. |Returns|: Promise that resolves with the set of session scoped rules.

Implementation

Future<List<Rule>> getSessionRules(GetRulesFilter? filter) async {
  var $res = await $js.chrome.declarativeNetRequest
      .getSessionRules(filter?.toJS)
      .toDart;
  return $res.toDart.cast<$js.Rule>().map((e) => Rule.fromJS(e)).toList();
}