mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Permission API
This commit is contained in:
parent
e394334739
commit
5ca3ee9474
10 changed files with 449 additions and 3 deletions
|
@ -10,6 +10,7 @@ use dom::bindings::str::DOMString;
|
|||
use dom::bluetooth::Bluetooth;
|
||||
use dom::mimetypearray::MimeTypeArray;
|
||||
use dom::navigatorinfo;
|
||||
use dom::permissions::Permissions;
|
||||
use dom::pluginarray::PluginArray;
|
||||
use dom::serviceworkercontainer::ServiceWorkerContainer;
|
||||
use dom::vr::VR;
|
||||
|
@ -23,7 +24,8 @@ pub struct Navigator {
|
|||
plugins: MutNullableJS<PluginArray>,
|
||||
mime_types: MutNullableJS<MimeTypeArray>,
|
||||
service_worker: MutNullableJS<ServiceWorkerContainer>,
|
||||
vr: MutNullableJS<VR>
|
||||
vr: MutNullableJS<VR>,
|
||||
permissions: MutNullableJS<Permissions>,
|
||||
}
|
||||
|
||||
impl Navigator {
|
||||
|
@ -35,6 +37,7 @@ impl Navigator {
|
|||
mime_types: Default::default(),
|
||||
service_worker: Default::default(),
|
||||
vr: Default::default(),
|
||||
permissions: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -123,6 +126,11 @@ impl NavigatorMethods for Navigator {
|
|||
fn Vr(&self) -> Root<VR> {
|
||||
self.vr.or_init(|| VR::new(&self.global()))
|
||||
}
|
||||
|
||||
// https://w3c.github.io/permissions/#navigator-and-workernavigator-extension
|
||||
fn Permissions(&self) -> Root<Permissions> {
|
||||
self.permissions.or_init(|| Permissions::new(&self.global()))
|
||||
}
|
||||
}
|
||||
|
||||
impl Navigator {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue