brouter-web/js/Browser.js
Norbert Renner 0fc60c1821 Work around iOS 3rd party browser download (#418)
- use FileReader.readAsDataURL (for iOS Chromium)
- add alternative Download from Server for now until proven in Prod and fixed in iOS Firefox (no i18n)
- replace cloud icons as client-side now
2022-05-28 14:27:32 +02:00

31 lines
1.1 KiB
JavaScript

(function () {
var touchScreen = (function () {
var result = null;
if ('maxTouchPoints' in navigator) {
result = navigator.maxTouchPoints > 0;
} else if (
window.matchMedia &&
window.matchMedia('(any-pointer:coarse),(any-pointer:fine),(any-pointer:none)').matches
) {
result = window.matchMedia('(any-pointer:coarse)').matches;
} else if ('msMaxTouchPoints' in navigator) {
result = navigator.msMaxTouchPoints > 0;
}
return result;
})(),
touchScreenDetectable = touchScreen !== null,
touch = touchScreenDetectable ? touchScreen : L.Browser.touch;
BR.Browser = {
touchScreen: touchScreen,
touchScreenDetectable: touchScreenDetectable,
touch: touch,
download:
'Blob' in window &&
'FileReader' in window &&
'readAsDataURL' in FileReader.prototype &&
'download' in document.createElement('a'),
};
})();