Skip to content

Commit

Permalink
tracked-controls: specific warning messages when gamepad access is bl…
Browse files Browse the repository at this point in the history
…ocked
  • Loading branch information
DougReeder committed Sep 30, 2024
1 parent 7a6a13d commit 9eaeb0f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/systems/tracked-controls-webvr.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ module.exports.System = registerSystem('tracked-controls-webvr', {
}
} catch (e) {
if (e.name === 'SecurityError') {
console.warn('A-Frame requires additional permissions to list the gamepads. If this is running in an IFRAME, you need to add `gamepads` to the `allow` attribute. If this is running as the top-level page, the HTTP `Permissions-Policy` header must not exclude this origin in the `gamepad` directive.', e);
if (window.self === window.top) {
console.warn('A-Frame requires additional permissions to list the gamepads. The HTTP `Permissions-Policy` header must not exclude this origin in the `gamepad` directive.', e);
} else {
console.warn('A-Frame requires additional permissions to list the gamepads. The iframe `allow` attribute must not block this origin.', e);
}
} else {
console.error('Can\'t update controller list:', e);
}
Expand Down

0 comments on commit 9eaeb0f

Please sign in to comment.