极简 It之家新闻列表

仅保留新闻列表

  1. // ==UserScript==
  2. // @name 极简 It之家新闻列表
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.5
  5. // @description 仅保留新闻列表
  6. // @author You
  7. // @match *://*.ithome.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function () {
  12. 'use strict';
  13.  
  14. var currentURL = window.location.href;
  15. var newsList = /list/;
  16.  
  17. setTimeout(() => {
  18. // 如果是新闻列表
  19. if (newsList.test(currentURL)) {
  20. // 新闻列表页
  21. $("html body").html($("#list .fl").html());
  22. $("html body").css({ "width": "850px", "margin": "0 auto" });
  23. $("ul.datel li a.t").css("width", "575px");
  24. } else {
  25. // 内容页面
  26. $("html body").html($("#dt.fl").html());
  27.  
  28. $("#dt>div:eq(1)").remove();
  29.  
  30. $("#dt .fl").css("width", "auto");
  31.  
  32. $("#dt .fl>script").remove();
  33.  
  34. $("#dt .fl .shareto").remove();
  35.  
  36. $("#dt .fl .related_post").remove();
  37.  
  38. $("#dt .fl iframe:first").remove();
  39.  
  40. $("img").each(function () {
  41. $(this).prop("src", $(this).data("original"))
  42. });
  43.  
  44. }
  45. }, 500);
  46. })();

QingJ © 2025

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