// ==UserScript== // @name Flet 中文网页文档取消登录限制 // @namespace http://tampermonkey.net/ // @version 0.2 // @description 移除 Flet 文档中的会员内容覆盖层和内容高度限制 // @author DuoDuo_cat // @match https://flet.qiannianlu.com/zh/docs/* // @grant none // ==/UserScript== (function() { 'use strict'; // 移除 class="member-content-overlay" 的 div 标签及其内含内容 function removeMemberContentOverlay() { const overlay = document.querySelector('.member-content-overlay'); if (overlay) { overlay.remove(); } } // 移除 class="carousel-container" 的 div 标签及其内含内容 function removeCarouselContainer() { const carouselContainer = document.querySelector('.carousel-container'); if (carouselContainer) { carouselContainer.remove(); } } // 将 class="mdx-content" 的 div 高度设置为 100% 显示全部内容 function removeMdxContentHeightLimit() { const mdxContent = document.querySelector('.mdx-content'); if (mdxContent) { mdxContent.style.maxHeight = 'none'; mdxContent.style.height = '120%'; } } // 修改 .mdx-content p 的 CSS 样式 function modifyMdxContentParagraphs() { const style = document.createElement('style'); style.textContent = ` .mdx-content p { margin: 5rem 0; } `; document.head.appendChild(style); } // 页面加载完成后执行 window.addEventListener('load', function() { removeMemberContentOverlay(); removeCarouselContainer(); removeMdxContentHeightLimit(); modifyMdxContentParagraphs(); }); // 监听 DOM 变化,处理动态加载的内容 const observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { removeMemberContentOverlay(); removeCarouselContainer(); removeMdxContentHeightLimit(); modifyMdxContentParagraphs(); }); }); observer.observe(document.body, { childList: true, subtree: true }); })();