spite / WebVR-Extension

Chrome DevTools extension to emulate WebVR API
MIT License
305 stars 43 forks source link

Setting frameData.pose (/w Origin Trial) #27

Open benfoxall opened 7 years ago

benfoxall commented 7 years ago

I'm absolutely sure that this is covered by #21, though I thought it might be useful to log a specific example of Origin Trial issues.

When viewing a page with an active webvr origin-trial, I get the following error:

TypeError: Cannot assign to read only property 'pose' of object '#<VRFrameData>'

screen shot 2017-02-18 at 12 56 39

It looks like I'm passing a native VRFrameData object which has a readonly pose attribute

spite commented 7 years ago

Yes, that's basically the issue, VRFrameData gets "nativised" after the page has loaded.

I've tried a few workarounds, and I don't really like none because they're mean guaranteed breakage at some point, and I don't want to be troubleshooting full time. The current solution i have in dev, for instance, doesn't work with your page. So yay.

To be honest, it's kind of annoying having to re-architect everything just because the combined hack of extensions injection and origin-trial enhancement.

For now I rather developers be able to use the emulator -since they can work without enabling the origin-trial- and inconvenience the users that access origin-trial sites since, well, they didn't have a VR device to begin with.

EDIT: it doesn't help either knowing that this is going to change, and rewriting the extension now doesn't exclude having to rewrite yet again in a few weeks.

spite commented 7 years ago

I think the only real option is to wait for the page to query for devices, and then start the API replacement…

sompylasar commented 6 years ago

I've got this TypeError: Cannot assign to read only property 'pose' of object '#<VRFrameData>' at https://threejs.org/examples/webvr_cubes.html with chrome://flags/#enable-webvr disabled (and a fresh launch of Chrome). What am I doing wrong?

Google Chrome 61.0.3163.100 (Official Build) (64-bit)
Revision 57c9d07b416b5a2ea23d28247300e4af36329bdc-refs/branch-heads/3163@{#1250}
OS Mac OS X
JavaScript V8 6.1.534.41
Flash 27.0.0.183 /Users/ivanbabak/Library/Application Support/Google/Chrome/PepperFlash/27.0.0.183/PepperFlashPlayer.plugin
User Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
Command Line /Applications/Google Chrome.app/Contents/MacOS/Google Chrome -psn_0_40970 --flag-switches-begin --enable-devtools-experiments --enable-es3-apis --enable-new-app-menu-icon --enable-features=GamepadExtensions --flag-switches-end