framework7io / framework7

Full featured HTML framework for building iOS & Android apps
http://framework7.io
MIT License
18.13k stars 3.23k forks source link

Cannot trigger html5 download with javascript on Android #1445

Closed kokororin closed 7 years ago

kokororin commented 7 years ago

This is a (multiple allowed):

What you did

Hi. I use javascript to trigger download files. code like

      var a = document.createElement('a');
      a.href = 'https://cache.pixiv.moe/aqours/music/442314572.mp3';
      a.setAttribute('download', true);
      a.className = 'external';
      document.body.appendChild(a);
      a.click();
      document.body.removeChild(a);

On PC Browser, it works well. On Chrome for Android and other Android Web Browser, when I click the button in the demo url, it doesn't work. There are two demo urls, the one which has hash nof7 doesn't have new Framework7,and it works well.While the other one with f7 initialized doesn't work.

Expected Behavior

Download should start

Actual Behavior

Download not start, nothing happened.

nolimits4web commented 7 years ago

Try


a.className = 'external no-fastclick';
kokororin commented 7 years ago

It works. Thank you!

lock[bot] commented 6 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.