Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update WebVRPolyfill to 0.10.3 to fix Chrome devicemotion regression #3453

Merged
merged 1 commit into from
Mar 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"style-attr": "^1.0.2",
"three": "github:supermedium/three.js#r90fixPoseAndRaycaster",
"three-bmfont-text": "^2.1.0",
"webvr-polyfill": "^0.9.40"
"webvr-polyfill": "^0.10.3"
},
"devDependencies": {
"browserify": "^13.1.0",
Expand Down
15 changes: 6 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
// Check before the polyfill runs.
window.hasNativeWebVRImplementation = !!window.navigator.getVRDisplays || !!window.navigator.getVRDevices;

window.WebVRConfig = window.WebVRConfig || {
// WebVR polyfill
var WebVRPolyfill = require('webvr-polyfill');
window.webvrpolyfill = new WebVRPolyfill({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can remove, might be helpful for debugging in the future

BUFFER_SCALE: 1,
CARDBOARD_UI_DISABLED: true,
ROTATE_INSTRUCTIONS_DISABLED: true,
TOUCH_PANNER_DISABLED: true,
MOUSE_KEYBOARD_CONTROLS_DISABLED: true
};

// WebVR polyfill
require('webvr-polyfill');
ROTATE_INSTRUCTIONS_DISABLED: true
});

var utils = require('./utils/');

Expand Down Expand Up @@ -83,7 +80,7 @@ require('./core/a-mixin');
require('./extras/components/');
require('./extras/primitives/');

console.log('A-Frame Version: 0.8.1 (Date 2018-03-14, Commit #5ead860)');
console.log('A-Frame Version: 0.8.1 (Date 2018-03-15, Commit #9941383)');
console.log('three Version:', pkg.dependencies['three']);
console.log('WebVR Polyfill Version:', pkg.dependencies['webvr-polyfill']);

Expand Down
2 changes: 1 addition & 1 deletion src/utils/device.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var vrDisplay;
var polyfilledVRDisplay;
var POLYFILL_VRDISPLAY_ID = 'Cardboard VRDisplay (webvr-polyfill)';
var POLYFILL_VRDISPLAY_ID = 'Cardboard VRDisplay';

if (navigator.getVRDisplays) {
navigator.getVRDisplays().then(function (displays) {
Expand Down
4 changes: 4 additions & 0 deletions tests/node/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ suite('node acceptance tests', function () {
setup(function () {
let _window = global.window = jsdom.jsdom().defaultView;
global.navigator = _window.navigator;
global.document = _window.document;
global.screen = {};
});

teardown(function () {
delete global.window;
delete global.navigator;
delete global.document;
delete global.screen;
});

test('can run in node', function () {
Expand Down