dict.cn修改网页标题

修改dict.cn页面标题,辅助notion

  1. // ==UserScript==
  2. // @name dict.cn修改网页标题
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.11
  5. // @description 修改dict.cn页面标题,辅助notion
  6. // @author silviode
  7. // @match https://dict.cn/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=dict.cn
  9. // @grant none
  10. // @license GPLv3
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. let explain_text = document.getElementsByTagName("h1")[0].innerText + " "
  17. let strongs = document.querySelectorAll("ul.dict-basic-ul>li")
  18. for(let i = 0; i < strongs.length - 1; i++){
  19. explain_text += strongs[i].innerText + " "
  20. }
  21.  
  22. document.title = explain_text
  23. // 如需使用手动解开注释,即删除// darkMode() 前面的反斜杠
  24. // darkMode()
  25.  
  26.  
  27. })();
  28.  
  29. function darkMode(){
  30. let mycolor = "#252629"
  31. document.bgColor = mycolor
  32. document.querySelector(".main").style.backgroundColor = mycolor
  33. document.querySelectorAll("i").forEach((i)=>{i.style.backgroundColor = mycolor})
  34. document.querySelectorAll("h3").forEach((i)=>{i.style.backgroundColor = mycolor})
  35. document.querySelectorAll("li").forEach((i)=>{i.style.color = "#CDCDCD"})
  36. document.querySelector(".top").style.backgroundColor = mycolor
  37. document.querySelector("#header").style.backgroundImage = "none"
  38. }

QingJ © 2025

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