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.
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.
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;
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
String toString() #
Returns a string representation of this object.
String toString() => jsProxy.toString();