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

Function showFixedElements

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

* 恢复之前隐藏的固定定位和粘性定位元素

()

Source from the content-addressed store, hash-verified

462 * 恢复之前隐藏的固定定位和粘性定位元素
463 */
464 function showFixedElements() {
465 const fixedElements = window._fh_fixed_elements || [];
466
467 fixedElements.forEach(item => {
468 const el = item.element;
469 if (el) {
470 // 恢复原始样式 - 修正:恢复 visibility 和 opacity
471 el.style.visibility = item.originalVisibility !== undefined ? item.originalVisibility : '';
472 el.style.opacity = item.originalOpacity !== undefined ? item.originalOpacity : '';
473 // Display 属性通常不需要在隐藏/显示 fixed 元素时修改,注释掉以防干扰
474 // if (item.originalDisplay !== undefined) {
475 // el.style.display = item.originalDisplay;
476 // }
477 }
478 });
479
480 window._fh_fixed_elements = null; // 清理存储的元素
481 }
482
483 // 定义全局的 cleanup 函数
484 function cleanup() {

Callers 2

cleanupFunction · 0.85
captureFullPageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected