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

Function showFeHelperUI

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

* 显示所有FeHelper UI元素 * 恢复所有带有 fehelper-ui-element 类或 data-fh-ui 属性的元素的显示状态 * @param {Object} originalDisplays 原始显示状态对象

(originalDisplays)

Source from the content-addressed store, hash-verified

402 * @param {Object} originalDisplays 原始显示状态对象
403 */
404 function showFeHelperUI(originalDisplays) { // Accept argument
405 originalDisplays = originalDisplays || window._fh_original_displays || {}; // Use passed or global
406 const uiElements = document.querySelectorAll('.fehelper-ui-element, [data-fh-ui="true"]');
407
408 uiElements.forEach((element) => {
409 const id = element.id;
410 if (id && id in originalDisplays) {
411 element.style.display = originalDisplays[id];
412 } else {
413 // Default restoration if ID mismatch or not found (less reliable)
414 element.style.display = '';
415 }
416 // Remove temporary ID if added and it wasn't originally present
417 if (id && id.startsWith('fh-temp-id-') && !(id in (window._fh_original_displays || {}))) {
418 element.removeAttribute('id');
419 }
420 });
421 }
422
423 /**
424 * 隐藏固定定位和粘性定位的元素

Callers 1

cleanupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected