зеркало из https://github.com/mozilla/lightbeam.git
fix for #236, downloads data directly now
This commit is contained in:
Родитель
e2b79ada25
Коммит
5781fabf9b
16
data/ui.js
16
data/ui.js
|
@ -70,9 +70,21 @@ window.addEventListener("DOMContentLoaded", function(){
|
|||
|
||||
});
|
||||
|
||||
document.querySelector(".download").addEventListener('click', function() {
|
||||
document.querySelector(".download").addEventListener('click', function(evt) {
|
||||
console.log('received export data');
|
||||
window.open('data:application/json,' + exportFormat(allConnections));
|
||||
var file = new Blob([exportFormat(allConnections)], {type: 'application/json'});
|
||||
var reader = new FileReader();
|
||||
var a = document.createElement('a');
|
||||
reader.onloadend = function(){
|
||||
a.href = reader.result;
|
||||
a.download = 'collusionData.json';
|
||||
a.target = '_blank';
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
evt.preventDefault();
|
||||
// window.open('data:application/json,' + exportFormat(allConnections));
|
||||
});
|
||||
|
||||
document.querySelector('.reset-data').addEventListener('click', function(){
|
||||
|
|
Загрузка…
Ссылка в новой задаче