restored Ryan's original code as per #181 and https://github.com/readium/readium-shared-js/commit/e41a3cc4aa781aad7487a3228817c789f0e2b465