Ensure that Firefox prompts for a filename/location when downloading query results as a CSV file. Fixes #4071

This commit is contained in:
Dave Page 2019-03-12 12:45:25 +00:00
parent eb1db50f85
commit 2356988bdf
2 changed files with 7 additions and 3 deletions

View File

@ -18,4 +18,5 @@ Bug fixes
| `Bug #3995 <https://redmine.postgresql.org/issues/3995>`_ - Avoid 'bogus varno' message from Postgres when viewing the SQL for a table with triggers.
| `Bug #4054 <https://redmine.postgresql.org/issues/4054>`_ - Handle resultsets with zero columns correctly in the Query Tool.
| `Bug #4060 <https://redmine.postgresql.org/issues/4060>`_ - Fix the latexpdf doc build.
| `Bug #4060 <https://redmine.postgresql.org/issues/4060>`_ - Fix the latexpdf doc build.
| `Bug #4071 <https://redmine.postgresql.org/issues/4071>`_ - Ensure that Firefox prompts for a filename/location when downloading query results as a CSV file.

View File

@ -3612,8 +3612,10 @@ define('tools.querytool', [
.done(function(response) {
let urlCreator = window.URL || window.webkitURL,
url = urlCreator.createObjectURL(response),
link = document.createElement('a'),
current_browser = pgAdmin.Browser.get_browser();
current_browser = pgAdmin.Browser.get_browser(),
link = document.createElement('a');
document.body.appendChild(link);
if (current_browser.name === 'IE' && window.navigator.msSaveBlob) {
// IE10+ : (has Blob, but not a[download] or URL)
@ -3624,6 +3626,7 @@ define('tools.querytool', [
link.click();
}
document.body.removeChild(link);
self.download_csv_obj = undefined;
// Enable the execute button
$('#btn-flash').prop('disabled', false);