request method
Requests access to the specified permissions, displaying a prompt to the
user if necessary. These permissions must either be defined in the
optional_permissions
field of the manifest or be required permissions
that were withheld by the user. Paths on origin patterns will be ignored.
You can request subsets of optional origin permissions; for example, if
you specify *://*/*
in the optional_permissions
section of the
manifest, you can request http://example.com/
. If there are any problems
requesting the permissions, runtime.lastError
will be set.
Implementation
Future<bool> request(Permissions permissions) async {
var $res = await promiseToFuture<bool>(
$js.chrome.permissions.request(permissions.toJS));
return $res;
}