diff options
| author | RblSb <msrblsb@gmail.com> | 2021-09-27 20:13:55 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2021-09-27 20:14:36 +0300 |
| commit | 1dc2722d509e578b243bfda1a675dcfdb6003941 (patch) | |
| tree | dd78e7e09432177f5ea4ed8a3febbfbf0d5113ec /res | |
| parent | d3c34032ef86163d683ef22906481e0f3196ae79 (diff) | |
Got a bug? Write /dump to chat as admin
And open new issue with received file.
Diffstat (limited to 'res')
| -rw-r--r-- | res/client.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/res/client.js b/res/client.js index 7a4dc47..9abfe25 100644 --- a/res/client.js +++ b/res/client.js @@ -1483,6 +1483,9 @@ client_Main.prototype = { break; case "Disconnected": break; + case "Dump": + client_Utils.saveFile("dump.json","application/json",data.dump.data); + break; case "Flashback": break; case "GetTime": @@ -1926,6 +1929,9 @@ client_Main.prototype = { case "clear": this.send({ type : "ClearChat"}); return true; + case "dump": + this.send({ type : "Dump"}); + return true; case "fb":case "flashback": this.send({ type : "Flashback"}); return false; @@ -2643,6 +2649,21 @@ client_Utils.browseFileUrl = function(onFileLoad,isBinary,revoke) { window.document.body.appendChild(input); input.click(); }; +client_Utils.saveFile = function(name,mime,data) { + var blob = new Blob([data],{ type : mime}); + var url = URL.createObjectURL(blob); + var a = window.document.createElement("a"); + a.download = name; + a.href = url; + a.onclick = function(e) { + e.cancelBubble = true; + e.stopPropagation(); + }; + window.document.body.appendChild(a); + a.click(); + window.document.body.removeChild(a); + URL.revokeObjectURL(url); +}; var client_players_Iframe = function(main,player) { this.playerEl = window.document.querySelector("#ytapiplayer"); this.main = main; |
