Dart Documentationchrome.runtimeMessageSender

MessageSender class

An object containing information about the script context that sent a message or request.

class MessageSender extends ChromeObject {
 MessageSender({Tab tab, String id, String url, String tlsChannelId}) {
   if (tab != null) this.tab = tab;
   if (id != null) this.id = id;
   if (url != null) this.url = url;
   if (tlsChannelId != null) this.tlsChannelId = tlsChannelId;
 }
 MessageSender.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);

 /**
  * The [tabs.Tab] which opened the connection, if any. This property will
  * *only* be present when the connection was opened from a tab (including
  * content scripts), and *only* if the receiver is an extension, not an app.
  */
 Tab get tab => _createTab(jsProxy['tab']);
 set tab(Tab value) => jsProxy['tab'] = jsify(value);

 /**
  * The ID of the extension or app that opened the connection, if any.
  */
 String get id => jsProxy['id'];
 set id(String value) => jsProxy['id'] = value;

 /**
  * The URL of the page or frame that opened the connection, if any. This
  * property will *only* be present when the connection was opened from a tab
  * or content script.
  */
 String get url => jsProxy['url'];
 set url(String value) => jsProxy['url'] = value;

 /**
  * The TLS channel ID of the web page that opened the connection, if requested
  * by the extension or app, and if available.
  */
 String get tlsChannelId => jsProxy['tlsChannelId'];
 set tlsChannelId(String value) => jsProxy['tlsChannelId'] = value;
}

Extends

ChromeObject > MessageSender

Constructors

new MessageSender({Tab tab, String id, String url, String tlsChannelId}) #

Create a new instance of a ChromeObject, which creates and delegates to a JsObject proxy.

docs inherited from ChromeObject
MessageSender({Tab tab, String id, String url, String tlsChannelId}) {
 if (tab != null) this.tab = tab;
 if (id != null) this.id = id;
 if (url != null) this.url = url;
 if (tlsChannelId != null) this.tlsChannelId = tlsChannelId;
}

new MessageSender.fromProxy(JsObject jsProxy) #

Create a new instance of a ChromeObject, which delegates to the given JsObject proxy.

docs inherited from ChromeObject
MessageSender.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);

Properties

String id #

The ID of the extension or app that opened the connection, if any.

String get id => jsProxy['id'];
set id(String value) => jsProxy['id'] = value;

final jsProxy #

inherited from ChromeObject
final dynamic jsProxy

Tab tab #

The tabs.Tab which opened the connection, if any. This property will only be present when the connection was opened from a tab (including content scripts), and only if the receiver is an extension, not an app.

Tab get tab => _createTab(jsProxy['tab']);
set tab(Tab value) => jsProxy['tab'] = jsify(value);

String tlsChannelId #

The TLS channel ID of the web page that opened the connection, if requested by the extension or app, and if available.

String get tlsChannelId => jsProxy['tlsChannelId'];
set tlsChannelId(String value) => jsProxy['tlsChannelId'] = value;

String url #

The URL of the page or frame that opened the connection, if any. This property will only be present when the connection was opened from a tab or content script.

String get url => jsProxy['url'];
set url(String value) => jsProxy['url'] = value;

Methods

JsObject toJs() #

inherited from ChromeObject
JsObject toJs() => jsProxy;

String toString() #

inherited from ChromeObject

Returns a string representation of this object.

docs inherited from Object
String toString() => jsProxy.toString();