changeset 1718:65c03d33c345

use "window.location" instead of "window.open()" to download archives
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 01 Dec 2020 10:21:37 +0100
parents 391c798e4dae
children 9a1f79d21a3f
files Applications/StoneWebViewer/WebApplication/app.js
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/StoneWebViewer/WebApplication/app.js	Tue Dec 01 10:08:26 2020 +0100
+++ b/Applications/StoneWebViewer/WebApplication/app.js	Tue Dec 01 10:21:37 2020 +0100
@@ -937,7 +937,16 @@
             var state = response.data['State'];
             if (state == 'Success') {
               that.creatingArchive = false;
-              window.open(that.globalConfiguration.OrthancApiRoot + '/jobs/' + that.archiveJob + '/archive');
+              var uri = that.globalConfiguration.OrthancApiRoot + '/jobs/' + that.archiveJob + '/archive';
+
+              /**
+               * The use of "window.open()" below might be blocked
+               * (depending on the browser criteria to block popup).
+               * As a consequence, we prefer to set "window.location".
+               * https://www.nngroup.com/articles/the-top-ten-web-design-mistakes-of-1999/
+               **/
+              // window.open(uri, '_blank');
+              window.location = uri;
             }
             else if (state == 'Running') {
               setTimeout(that.CheckIsDownloadComplete, 1000);