MCPcopy
hub / github.com/zxlie/FeHelper / updateProgressUI

Function updateProgressUI

apps/screenshot/content-script.js:329–351  ·  view source on GitHub ↗

* 更新截图进度UI * @param {number} percent 进度百分比(0-1) * @param {string} [text] 可选的文本更新

(percent, text)

Source from the content-addressed store, hash-verified

327 * @param {string} [text] 可选的文本更新
328 */
329 function updateProgressUI(percent, text) {
330 const progressContainer = document.getElementById('fehelper-screenshot-progress');
331 if (!progressContainer) return;
332
333 const progressBar = progressContainer.querySelector('.fh-progress-bar');
334 const percentText = progressContainer.querySelector('.fh-progress-percent');
335
336 if (progressBar) {
337 const percentage = Math.min(Math.max(percent * 100, 0), 100);
338 progressBar.style.width = `${percentage}%`;
339 }
340
341 if (percentText) {
342 percentText.textContent = `${Math.round(percent * 100)}%`;
343 }
344
345 if (text) {
346 const textElement = progressContainer.querySelector('.fh-progress-text');
347 if (textElement) {
348 textElement.textContent = text;
349 }
350 }
351 }
352
353 /**
354 * 取消截图操作

Callers 5

content-script.jsFile · 0.85
captureVisibleFunction · 0.85
captureFullPageFunction · 0.85
finishCaptureFunction · 0.85
captureFailureHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected