mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Auto merge of #27429 - asajeffrey:webxr-user-intent-pref, r=Manishearth
Add a pref to indicate user intent to enter webxr <!-- Please describe your changes on the following line: --> Add a pref to indicate that the user has indicated intent to enter webxr. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes do not require tests because it's a command-line pref <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
c26a803fee
4 changed files with 10 additions and 2 deletions
|
@ -301,6 +301,8 @@ mod gen {
|
|||
enabled: bool,
|
||||
},
|
||||
sessionavailable: bool,
|
||||
#[serde(rename = "dom.webxr.unsafe-assume-user-intent")]
|
||||
unsafe_assume_user_intent: bool,
|
||||
},
|
||||
worklet: {
|
||||
blockingsleep: {
|
||||
|
|
|
@ -162,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