mirror of
https://github.com/servo/servo.git
synced 2025-08-01 19:50:30 +01:00
Add a pref to indicate user intent to enter webxr
This commit is contained in:
parent
0d77e0f6cf
commit
4894e8f2c4
3 changed files with 10 additions and 2 deletions
|
@ -26,6 +26,7 @@ use ipc_channel::ipc::{self as ipc_crate, IpcReceiver};
|
|||
use ipc_channel::router::ROUTER;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use profile_traits::ipc;
|
||||
use servo_config::pref;
|
||||
use std::cell::Cell;
|
||||
use std::rc::Rc;
|
||||
use webxr_api::{Error as XRError, Frame, Session, SessionInit, SessionMode};
|
||||
|
@ -161,8 +162,12 @@ impl XRSystemMethods for XRSystem {
|
|||
|
||||
if mode != XRSessionMode::Inline {
|
||||
if !ScriptThread::is_user_interacting() {
|
||||
promise.reject_error(Error::Security);
|
||||
return promise;
|
||||
if pref!(dom.webxr.unsafe_assume_user_intent) {
|
||||
warn!("The dom.webxr.unsafe-assume-user-intent preference assumes user intent to enter WebXR.");
|
||||
} else {
|
||||
promise.reject_error(Error::Security);
|
||||
return promise;
|
||||
}
|
||||
}
|
||||
|
||||
if self.pending_or_active_session() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue