MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / updateProgress

Function updateProgress

example/tests/gm_download_test.js:319–327  ·  view source on GitHub ↗
(loaded, total)

Source from the content-addressed store, hash-verified

317 $progressBar.style.width = "0%";
318 }
319 function updateProgress(loaded, total) {
320 if (total > 0) {
321 $progressBar.style.width = Math.min(100, Math.round((loaded / total) * 100)) + "%";
322 } else {
323 // Unknown total — fake an indeterminate bar that creeps up.
324 const cur = parseFloat($progressBar.style.width) || 0;
325 $progressBar.style.width = Math.min(95, cur + 5) + "%";
326 }
327 }
328 function hideProgress() {
329 $progressWrap.style.display = "none";
330 $progressBar.style.width = "0%";

Callers 2

onprogressFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected