Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add polyfill
  • Loading branch information
dmarcos committed Oct 13, 2022
commit b52364138e19fc533bb66f1d6a5f1ed270a6761f
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"custom-event-polyfill": "^1.0.6",
"debug": "ngokevin/debug#noTimestamp",
"deep-assign": "^2.0.0",
"document-register-element": "^1.13.2",
"@webreflection/custom-elements": "^1.1.0",
"load-bmfont": "^1.2.3",
"object-assign": "^4.0.1",
"present": "0.0.6",
Expand Down
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
// Polyfill `Promise`.
window.Promise = window.Promise || require('promise-polyfill');

// Custom Elements v1 polyfill
if (!window.customElements) {
const customElementsPolyfill = require('@webreflection/custom-elements');
customElementsPolyfill(window || global);
}

// WebVR polyfill
// Check before the polyfill runs.
window.hasNativeWebVRImplementation = !!window.navigator.getVRDisplays ||
Expand Down