Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
HttpAnimation authored Jun 20, 2023
1 parent 0027994 commit 434dfa5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
<button class="btn stop">Stop</button>
<button class="btn download">Download found</button>
<button class="btn download-error">Download errors</button>
<button class="btn download-all">Download all</button>
</div>
<div class="btn-group">
<button class="btn speed slow">Slow</button>
Expand Down Expand Up @@ -206,7 +207,19 @@
URL.revokeObjectURL(url);
});

// Speed buttons event listeners
document.querySelector('.btn.download-all').addEventListener('click', function() {
const consoleEl = document.querySelector('.console');
const allUrls = consoleEl.querySelectorAll('p');
const content = [...allUrls].map(url => url.innerText).join('\n');
const file = new Blob([content], {type: 'text/plain'});
const url = URL.createObjectURL(file);
const a = document.createElement('a');
a.href = url;
a.download = 'all_urls.txt';
a.click();
URL.revokeObjectURL(url);
});

document.querySelector('.btn.speed.slow').addEventListener('click', function() {
if (intervalId) {
clearInterval(intervalId);
Expand Down

0 comments on commit 434dfa5

Please sign in to comment.