问题
I have an anchor on my page with href
set to a PDF file URL and download
set to a string. With first attempt the file is downloaded ok but second time and consecutive attempts it doesn't work with the error "This site attempted to download multiple files automatically". When I try with firefox the download works every single time. What's going on here?
回答1:
Setting -> advanced -> setting content -> Automatic downloads
You have two options. Use the slider next to Do not allow any site to download multiple files automatically to turn on this restriction. This setting causes Chrome to block all automatic subsequent file downloads following the first one, which you initiate. If you move the slider to the off position, you see Ask when a site tries to download files automatically after the first file, which is the recommended setting. This option will prompt you each time a website attempts to download multiple files automatically following the first one.
来源:https://stackoverflow.com/questions/52917030/chrome-blocks-download-at-second-attempt