移除知乎热门(remove zhihu top story)

try to take over the world!

  1. // ==UserScript==
  2. // @name 移除知乎热门(remove zhihu top story)
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author rainyleo
  7. // @match https://www.zhihu.com/
  8. // @grant none
  9. // ==/UserScript==
  10. (function() {
  11. 'use strict';
  12. function remove() {
  13. const items = [...document.querySelectorAll('.TopstoryItem')];
  14. if (items.length) {
  15. for (const item of items) {
  16. const title = item.querySelector('.FeedSource-firstline');
  17. if (title && title.textContent.includes('热门内容')) {
  18. item.remove();
  19. }
  20. }
  21. }
  22. }
  23. remove();
  24.  
  25. const container = document.querySelector(".TopstoryMain >div");
  26. const ob = new MutationObserver(remove);
  27. const config = { childList: true };
  28. ob.observe(container, config);
  29.  
  30. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址