public inbox for pve-devel@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

* [pve-devel] applied: [PATCH manager] ui: set file name for spice console download in chrome
  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 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2021-04-23 13:30 UTC (permalink / raw)
  To: Proxmox VE development discussion, Lorenz Stechauner

On 22.04.21 09:49, Lorenz Stechauner wrote:
> 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.
> 

note, this seems like a bit of a crammed commit message text-width wise.
I amended that to match the text-width = 69, as it should neither be overly
long, nor really short.

If you use vim for writing those I suggest adding a hunk like the following
to your vimrc:

au FileType gitcommit setlocal tw=69


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

applied, thanks! Behavior is really better this way in Chrome/Chromium.
My Firefox here already worked fine, so seems not required for it anyway.




^ 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 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