Dart Documentationchrome.declarativeWebRequestChromeDeclarativeWebRequest

ChromeDeclarativeWebRequest class

class ChromeDeclarativeWebRequest extends ChromeApi {
 static final JsObject _declarativeWebRequest = chrome['declarativeWebRequest'];

 ChromeDeclarativeWebRequest._();

 bool get available => _declarativeWebRequest != null;

 Stream get onRequest => _onRequest.stream;

 final ChromeStreamController _onRequest =
     new ChromeStreamController.noArgs(_declarativeWebRequest, 'onRequest');

 /**
  * Fired when a message is sent via
  * [declarativeWebRequest.SendMessageToExtension] from an action of the
  * declarative web request API.
  */
 Stream<Map> get onMessage => _onMessage.stream;

 final ChromeStreamController<Map> _onMessage =
     new ChromeStreamController<Map>.oneArg(_declarativeWebRequest, 'onMessage', mapify);

 void _throwNotAvailable() {
   throw new UnsupportedError("'chrome.declarativeWebRequest' is not available");
 }
}

Extends

ChromeApi > ChromeDeclarativeWebRequest

Properties

final bool available #

Returns true if the API is available. The common causes of an API not being avilable are:

  • a permission is missing in the application's manifest.json file
  • the API is defined on a newer version of Chrome then the current runtime
docs inherited from ChromeApi
bool get available => _declarativeWebRequest != null;

final Stream<Map> onMessage #

Fired when a message is sent via declarativeWebRequest.SendMessageToExtension from an action of the declarative web request API.

Stream<Map> get onMessage => _onMessage.stream;

final Stream onRequest #

Stream get onRequest => _onRequest.stream;