Last active
June 20, 2020 12:16
-
-
Save StefH/5795ae24c4b54ad9320808535286bb00 to your computer and use it in GitHub Desktop.
window.loadResourceCallback
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<app> | |
<div class="container-fluid"> | |
<div class="row"> | |
<div class="col-2"></div> | |
<div class="col-8"> | |
<p></p> | |
Loading Blazor WebAssembly... | |
<br /> | |
<div class="progress"> | |
<div id="progressbar" class="progress-bar progress-bar-striped active" role="progressbar" style="width:0"></div> | |
</div> | |
</div> | |
<div class="col-2"></div> | |
</div> | |
</div> | |
</app> | |
<script type="text/javascript"> | |
var i = 0; | |
window.loadResourceCallback = (total, name, response) => { | |
if (name.endsWith('.dll')) { | |
i++; | |
const value = parseInt((i * 100.0) / total); | |
const pct = value + '%'; | |
const progressbar = document.getElementById('progressbar'); | |
progressbar.style.width = pct; | |
console.log(i + '/' + total + ' (' + pct + ') ' + name); | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment