all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] ui: set file name for spice console download in chrome
@ 2021-04-22  7:49 Lorenz Stechauner
  2021-04-23 13:30 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Lorenz Stechauner @ 2021-04-22  7:49 UTC (permalink / raw)
  To: pve-devel

When the virt-viewer file is downloaded we already set
a file name in Android, so the file type may be
recognized. Also doing this in Chrome (and Chromium
based browsers) allows users to "alyways open files of
this type". So the browser automatically opens the
console window without user interaction.

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
---
 www/manager6/Utils.js | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index f502950f..35d49630 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -1358,11 +1358,10 @@ Ext.define('PVE.Utils', {
 		css: 'display:none;visibility:hidden;height:0px;',
 	    });
 
-	    // Note: we need to tell android the correct file name extension
+	    // Note: we need to tell Android and Chrome the correct file name extension
 	    // but we do not set 'download' tag for other environments, because
 	    // It can have strange side effects (additional user prompt on firefox)
-	    var andriod = !!navigator.userAgent.match(/Android/i);
-	    if (andriod) {
+	    if (navigator.userAgent.match(/Android|Chrome/i)) {
 		link.download = name;
 	    }
 
-- 
2.20.1




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-23 13:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22  7:49 [pve-devel] [PATCH manager] ui: set file name for spice console download in chrome Lorenz Stechauner
2021-04-23 13:30 ` [pve-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal