I had a project which is export a csv file and update the download time in admin page and it's worked normally when the browser Ask where to save each file before downloading is disabled. But just for example if the administrator accidentally turn it on then it will create a bug.
The bug : If he/she pressed cancel then my ajax code will still return success call and the download time will be updated despite no files are downloaded Bug Occur when press this button
I don't know if there is a way to check if the Ask where to save each file before downloading is activated or not ?
I'm using Laravel 8 btw , and here is my JS code : enter image description here