(text, filename, type)
| 561 | }, |
| 562 | |
| 563 | downloadFile(text, filename, type) { |
| 564 | let blob = new Blob([text], { type: type || 'application/octet-stream' }); |
| 565 | let a = document.createElement('a'); |
| 566 | a.href = URL.createObjectURL(blob); |
| 567 | a.download = filename; |
| 568 | document.body.appendChild(a); |
| 569 | a.click(); |
| 570 | setTimeout(() => { URL.revokeObjectURL(a.href); a.remove(); }, 1000); |
| 571 | }, |
| 572 | |
| 573 | importFromFile() { |
| 574 | this.pickFile(['.user.js', '.js', '.json'], (file, text) => { |
nothing calls this directly
no test coverage detected