download playlists as txt

This commit is contained in:
Bnyro
2022-08-02 10:08:26 +02:00
parent e0cf9e6182
commit fa88624f8b
3 changed files with 30 additions and 1 deletions

View File

@@ -220,6 +220,15 @@ const mixin = {
const localSubscriptions = this.getLocalSubscriptions();
return localSubscriptions.join(",");
},
download(text, filename) {
var element = document.createElement("a");
element.setAttribute("href", "data:text/plain;charset=utf-8," + encodeURIComponent(text));
element.setAttribute("download", filename);
element.style.display = "none";
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
},
},
computed: {
theme() {