Downloads with extension | No save file dialog
-
I have noticed on several extensions that when you trying to imitate file download process using 'a' tag and 'click' function, you actually can't do it from extension pop up because there's no save file dialog.
I tried the "save extension" and my own code in Firefox Dev Edition and regular Chrome and it's working there but not in Vivaldi.
I can not use the extension itself as an example because to test it you have to OAuth to another website through that extension. But I can show basic code. The actual donwload process is thus:const encodedUri = `data:text/csv;charset=utf-8,${encodeURIComponent(JSON.stringify(exportObj))}`; try { const link = document.createElement('a'); link.setAttribute('href', encodedUri); link.setAttribute( 'download', `malsync_${new Date().toJSON().slice(0, 10).replace(/-/g, '/')}.txt`, ); document.body.appendChild(link); link.click(); } catch (e) { window.open(encodedUri); }
The like link.click() don't work. There's no error either, not in console not using debugger. Catch also not triggering. It just like passes by.
I managed to find a workaround - you can trigger a download window if you go to Extension -> Choose extension -> Press Extension options to open pop up, and if you try to download it from here then it will work.
Or the second way to fix it - to use PWA page, if you try to download from extensions PWA page, you can do it without problem.And again, other browsers works without any difficulties.
Info:
Vivaldi 6.9.3447.51 (Stable channel) (64-bit) -
@happyuni more important thing: have you reported as a bug? Otherwise it won't be analyzed.
-
@Hadden89 Oh, where do I do it? Here - https://vivaldi.com/bugreport/ ? Sorry I thought this forum is also for a bug reporting
-
@happyuni The forum is more to keep track about a specific bug, being the bug tracker closed