Aquí está mi secuencia de comandos para descargar una imagen que funciona perfectamente en la computadora, pero no funciona en los navegadores móviles, no ocurre nada al hacer clic en el botón
Función
<script> function forceDownload(url, fileName){ var xhr = new XMLHttpRequest(); xhr.open("GET", url, true); xhr.responseType = "blob"; xhr.onload = function(){ var urlCreator = window.URL || window.webkitURL; var imageUrl = urlCreator.createObjectURL(this.response); var tag = document.createElement('a'); tag.href = imageUrl; tag.download = fileName; document.body.appendChild(tag); tag.click(); document.body.removeChild(tag); } xhr.send(); } </script>El guión HTML
<button onclick=forceDownload("https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png","Test") type="button">Download</button></a>