uppy/examples/dev/index.js
Evgenia Karunus 7ce63fcb7e Accessibility follow-up PR: make all svgs not focusable in IE11 (#1662)
* /examples/dev - added polyfills for easy development in IE11

* @uppy/dashboard - made all svgs not focusable in IE11

* /examples/dev - started sharing serviceWorker registration code

* /examples/dev - added polyfills for IE11 to dev bundle
2019-06-17 17:08:05 +03:00

24 lines
684 B
JavaScript

// Polyfills, primarily for testing in IE11
require('es6-promise/auto')
require('whatwg-fetch')
const DragDrop = require('./DragDrop.js')
const Dashboard = require('./Dashboard.js')
switch (window.location.pathname.toLowerCase()) {
case '/':
case '/dashboard.html': Dashboard(); break
case '/dragdrop.html': DragDrop(); break
}
if ('serviceWorker' in navigator) {
// eslint-disable-next-line compat/compat
navigator.serviceWorker
.register('/sw.js')
.then((registration) => {
console.log('ServiceWorker registration successful with scope: ', registration.scope)
})
.catch((error) => {
console.log('Registration failed with ' + error)
})
}