Remove Zhida Link and ZDI--FourPointedStar at Zhihu Site

Replace specific links with text-only spans, remove ✦ superscript, too.

< Feedback on Remove Zhida Link and ZDI--FourPointedStar at Zhihu Site

Review: Good - script works

§
Posted: 2025-01-01

可以同时适配 zhuanlan.zhihu.com

// @match        *://*.zhihu.com/*

个人喜欢把超链接整个干掉:

    // Function to process both links and SVGs
    function processNode(node) {
        const links = node.querySelectorAll('a.RichContent-EntityWord');
        links.forEach(link => {
            if (link.dataset.modified) return; // Skip already processed links
            let keyword = link.textContent;
            if (keyword) {
                const textNode = document.createTextNode(keyword); // Create a text node with the link's text
                link.replaceWith(textNode); // Replace the <a> element with the text node
            }
        });
    }

Post reply

Sign in to post a reply.