New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 764447 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: ----
Proj-XR



Sign in to add a comment

Exception message for use of WebVR in a cross-origin iframe is incorrect

Project Member Reported by ddorwin@chromium.org, Sep 12 2017

Issue description

Starting in M62, Feature Policy must be used to enable WebVR in cross-origin iframes. Otherwise, navigator.getVRDisplays() throws.

As noted in  issue 764407 , the rejection message is "The object is no longer associated with a document." This message comes from NavigatorVR.cpp:RejectNavigatorDetached(), which was reused when adding the Feature Policy requirement [1].

We should review all uses of RejectNavigatorDetached() and provide different strings where appropriate.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/636663/10/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp
 
Since this is a web-facing change in M62 and the message to developers is unhelpful, we may want to do a low-risk fix and consider merging it (and do a more complete fix later if necessary).
Cc: -bshe@chromium.org bajones@chromium.org
Owner: bshe@chromium.org
Status: Assigned (was: Available)
bshe@, can you please take a look? cc'ing bajones@ in case you have input on the error message.
We should look at the messages other Feature Policy-using features use.

Comment 4 by bshe@chromium.org, Sep 13 2017

We could do something similar like what USB is doing here:
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/webusb/USB.cpp?rcl=e7d7e16bb5af641db6f4e77f1877605a005cd0ee&l=85

I will upload a patch and we can discuss strings/messages in the CL.

Comment 5 by bshe@chromium.org, Sep 13 2017

uploaded https://chromium-review.googlesource.com/c/chromium/src/+/665418 for review. Feel free to add yourself as reviewer. 
Project Member

Comment 6 by bugdroid1@chromium.org, Sep 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2ada1d99198538352ade379b4d9d518b3e253211

commit 2ada1d99198538352ade379b4d9d518b3e253211
Author: Biao She <bshe@chromium.org>
Date: Wed Sep 20 00:13:45 2017

More accurate WebVR API exception message

Bug:  764447 
Change-Id: I914d1703cc5f3564503810fcbd0b0058e392fa7b
Reviewed-on: https://chromium-review.googlesource.com/665418
Commit-Queue: Biao She <bshe@chromium.org>
Reviewed-by: David Dorwin <ddorwin@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503001}
[modify] https://crrev.com/2ada1d99198538352ade379b4d9d518b3e253211/third_party/WebKit/LayoutTests/vr/getVRDisplays_detached.html
[modify] https://crrev.com/2ada1d99198538352ade379b4d9d518b3e253211/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp

Comment 7 by bshe@chromium.org, Sep 20 2017

Status: Fixed (was: Assigned)

Comment 8 by bshe@chromium.org, Sep 20 2017

Sorry. Didn't notice the it is marked as M62 before I mark it as fixed.
Do we want to merge it back to M62? @bajones @ddorwin @vollick
I don't feel this is super important but I might not have enough context.
The concern is that we changed API behavior in M62 but provide an unhelpful message to developers that might encounter it. The change is part of a new Origin Trial and will be communicated to existing sites, but there is no guarantee developers will connect the two.

Comment 10 by bshe@chromium.org, Sep 21 2017

Labels: Merge-Request-62 OS-Android
Status: Started (was: Fixed)
OK. Try to merge it back to M62 then.
Project Member

Comment 11 by sheriffbot@chromium.org, Sep 21 2017

Labels: -Merge-Request-62 Merge-Review-62 Hotlist-Merge-Review
This bug requires manual review: M62 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), bhthompson@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Can this merge break something in M62?
Is this merge safe for M62? Please provide the rationale why this has to be in M62.
Sorry for the slow reply. The rationale is that we'd made a behavior change in 62 but our error message that will be hit by developers that are affected by this behavior change is incorrect. We'll try to do developer outreach, but the worry is that some developers will be confused.

As for risk, it's a small change, and because the change is limited to NavigatorVR, any potential breakage should only affect VR.
Labels: -Hotlist-Merge-Review -Merge-Review-62 Merge-Approved-62
Thanks vollick@! Merge approved to branch 3202. 
Project Member

Comment 16 by bugdroid1@chromium.org, Sep 29 2017

Labels: -merge-approved-62 merge-merged-3202
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a8247326522c7333a5d9d887d4d8632f7316a0f2

commit a8247326522c7333a5d9d887d4d8632f7316a0f2
Author: Biao She <bshe@chromium.org>
Date: Fri Sep 29 18:59:00 2017

More accurate WebVR API exception message

TBR=bshe@chromium.org

(cherry picked from commit 2ada1d99198538352ade379b4d9d518b3e253211)

Bug:  764447 
Change-Id: I914d1703cc5f3564503810fcbd0b0058e392fa7b
Reviewed-on: https://chromium-review.googlesource.com/665418
Commit-Queue: Biao She <bshe@chromium.org>
Reviewed-by: David Dorwin <ddorwin@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#503001}
Reviewed-on: https://chromium-review.googlesource.com/693011
Reviewed-by: Biao She <bshe@chromium.org>
Cr-Commit-Position: refs/branch-heads/3202@{#516}
Cr-Branched-From: fa6a5d87adff761bc16afc5498c3f5944c1daa68-refs/heads/master@{#499098}
[modify] https://crrev.com/a8247326522c7333a5d9d887d4d8632f7316a0f2/third_party/WebKit/LayoutTests/vr/getVRDisplays_detached.html
[modify] https://crrev.com/a8247326522c7333a5d9d887d4d8632f7316a0f2/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp

Project Member

Comment 17 by bugdroid1@chromium.org, Sep 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8b8180a6d363f2d07b3141d63f116038fd14b6a0

commit 8b8180a6d363f2d07b3141d63f116038fd14b6a0
Author: Biao She <bshe@chromium.org>
Date: Sat Sep 30 00:20:51 2017

Revert "More accurate WebVR API exception message"

This reverts commit a8247326522c7333a5d9d887d4d8632f7316a0f2.

Reason for revert:
Bad merge. Unused variable.


Original change's description:
> More accurate WebVR API exception message
> 
> TBR=bshe@chromium.org
> 
> (cherry picked from commit 2ada1d99198538352ade379b4d9d518b3e253211)
> 
> Bug:  764447 
> Change-Id: I914d1703cc5f3564503810fcbd0b0058e392fa7b
> Reviewed-on: https://chromium-review.googlesource.com/665418
> Commit-Queue: Biao She <bshe@chromium.org>
> Reviewed-by: David Dorwin <ddorwin@chromium.org>
> Reviewed-by: Brandon Jones <bajones@chromium.org>
> Cr-Original-Commit-Position: refs/heads/master@{#503001}
> Reviewed-on: https://chromium-review.googlesource.com/693011
> Reviewed-by: Biao She <bshe@chromium.org>
> Cr-Commit-Position: refs/branch-heads/3202@{#516}
> Cr-Branched-From: fa6a5d87adff761bc16afc5498c3f5944c1daa68-refs/heads/master@{#499098}

TBR=ddorwin@chromium.org,bshe@chromium.org,bajones@chromium.org

Change-Id: I6f516229ffa8d0a51b90b86713e90e3934d97b10
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  764447 
Reviewed-on: https://chromium-review.googlesource.com/693012
Reviewed-by: Biao She <bshe@chromium.org>
Cr-Commit-Position: refs/branch-heads/3202@{#524}
Cr-Branched-From: fa6a5d87adff761bc16afc5498c3f5944c1daa68-refs/heads/master@{#499098}
[modify] https://crrev.com/8b8180a6d363f2d07b3141d63f116038fd14b6a0/third_party/WebKit/LayoutTests/vr/getVRDisplays_detached.html
[modify] https://crrev.com/8b8180a6d363f2d07b3141d63f116038fd14b6a0/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp

Project Member

Comment 18 by bugdroid1@chromium.org, Sep 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e39c763bf31c86b2dbeacc0b62f20aab439bf26b

commit e39c763bf31c86b2dbeacc0b62f20aab439bf26b
Author: Biao She <bshe@chromium.org>
Date: Sat Sep 30 01:07:03 2017

Reland  "More accurate WebVR API exception message"

This reverts commit 8b8180a6d363f2d07b3141d63f116038fd14b6a0.
And applied a fix on top it.


TBR=bajones@chromium.org, bshe@chromium.org, ddrowin@chromium.org

Bug:  764447 
Change-Id: I8ebade1b184079bf60e85e6438251d8c7a0b1e83
Reviewed-on: https://chromium-review.googlesource.com/693517
Reviewed-by: Biao She <bshe@chromium.org>
Cr-Commit-Position: refs/branch-heads/3202@{#526}
Cr-Branched-From: fa6a5d87adff761bc16afc5498c3f5944c1daa68-refs/heads/master@{#499098}
[modify] https://crrev.com/e39c763bf31c86b2dbeacc0b62f20aab439bf26b/third_party/WebKit/LayoutTests/vr/getVRDisplays_detached.html
[modify] https://crrev.com/e39c763bf31c86b2dbeacc0b62f20aab439bf26b/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp

Comment 19 by bshe@chromium.org, Oct 2 2017

Status: Fixed (was: Started)
I think the new message is still not very helpful:

eGKmmq:1 Uncaught (in promise) DOMException: Access to the method is blocked on a user gesture in cross-origin embedded frames.
Promise rejected (async)
(anonymous) @ pen.js:98

This is from loading https://codepen.io/Mamboleoo/pen/eGKmmq?editors=0010 which was linked on the WebVR Slack when feature policy is disabled. (If feature policy is enabled, I get "Access to the feature \"vr\" is disallowed by feature policy." which is clearer.)

Could you rephrase that to replace "the method" with "Using VR APIs" or similar to give the message some context? It's not really clear from the message that this is referring to getVRDisplays.
Status: Assigned (was: Fixed)
Owner: offenwanger@chromium.org
Status: Started (was: Assigned)
Project Member

Comment 23 by bugdroid1@chromium.org, Oct 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c58b83f35b22710ee19da555457156350bb8ac0d

commit c58b83f35b22710ee19da555457156350bb8ac0d
Author: Anna Maria <offenwanger@chromium.org>
Date: Tue Oct 17 19:44:26 2017

Clarify error message for cross-origin getVRDisplays use

Previous error message was confusing as it only mentioned 'the method'
without giving any context for what 'the method' was.

Bug:  764447 
Change-Id: Ia59c07bde9b9965674b3fee746b5152e33818d79
Reviewed-on: https://chromium-review.googlesource.com/722030
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: David Dorwin <ddorwin@chromium.org>
Commit-Queue: Anna Offenwanger <offenwanger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509490}
[modify] https://crrev.com/c58b83f35b22710ee19da555457156350bb8ac0d/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp

Cc: offenwanger@chromium.org
Owner: bshe@chromium.org
Status: Fixed (was: Started)
Thanks, offenwanger. I'm moving the state of the issue back to the original bug fix.

To summarize:
* The exception message is correct in M62 (merged) and M63.
* The cross-origin message when Feature Policy is disabled was clarified in M64.
Components: Blink>WebXR

Sign in to add a comment