public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Lorenz Stechauner <l.stechauner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] ui: set file name for spice console download in chrome
Date: Thu, 22 Apr 2021 09:49:02 +0200	[thread overview]
Message-ID: <20210422074902.32118-1-l.stechauner@proxmox.com> (raw)

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




             reply	other threads:[~2021-04-22  7:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22  7:49 Lorenz Stechauner [this message]
2021-04-23 13:30 ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210422074902.32118-1-l.stechauner@proxmox.com \
    --to=l.stechauner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal