ChromeExtension class

Properties

hashCode int
The hash code for this object.
no setterinherited
inIncognitoContext bool?
True for content scripts running inside incognito tabs, and for extension pages running inside an incognito process. The latter only applies to extensions with 'split' incognito_behavior.
no setter
isAvailable bool
no setter
lastError ExtensionLastError?
Set for the lifetime of a callback if an ansychronous extension api has resulted in an error. If no error has occured lastError will be undefined.
no setter
onRequest EventStream<OnRequestEvent>
Fired when a request is sent from either an extension process or a content script.
no setter
onRequestExternal EventStream<OnRequestExternalEvent>
Fired when a request is sent from another extension.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getBackgroundPage() JSObject?
Returns the JavaScript 'window' object for the background page running inside the current extension. Returns null if the extension has no background page.
getExtensionTabs(int? windowId) List<JSObject>
Returns an array of the JavaScript 'window' objects for each of the tabs running inside the current extension. If windowId is specified, returns only the 'window' objects of tabs attached to the specified window. returns Array of global window objects
getURL(String path) String
Converts a relative path within an extension install directory to a fully-qualified URL. path A path to a resource within an extension expressed relative to its install directory. returns The fully-qualified URL to the resource.
getViews(GetViewsFetchProperties? fetchProperties) List<JSObject>
Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension. returns Array of global objects
isAllowedFileSchemeAccess() Future<bool>
Retrieves the state of the extension's access to the 'file://' scheme. This corresponds to the user-controlled per-extension 'Allow access to File URLs' setting accessible via the chrome://extensions page.
isAllowedIncognitoAccess() Future<bool>
Retrieves the state of the extension's access to Incognito-mode. This corresponds to the user-controlled per-extension 'Allowed in Incognito' setting accessible via the chrome://extensions page.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendRequest(String? extensionId, Object request) Future<Object>
Sends a single request to other listeners within the extension. Similar to runtime.connect, but only sends a single request with an optional response. The extension.onRequest event is fired in each page of the extension. extensionId The extension ID of the extension you want to connect to. If omitted, default is your own extension.
setUpdateUrlData(String data) → void
Sets the value of the ap CGI parameter used in the extension's update URL. This value is ignored for extensions that are hosted in the Chrome Extension Gallery.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited