Luogu Better Plus

Luogu is different from the past.

  1. // ==UserScript==
  2. // @name Luogu Better Plus
  3. // @namespace https://www.luogu.com.cn/user/1030733
  4. // @version 1.0.2.8
  5. // @description Luogu is different from the past.
  6. // @author nythm
  7. // @match https://www.luogu.com.cn/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=luogu.com.cn
  9. // @grant GM_setValue
  10. // @grant GM_getValue
  11. // @grant GM_registerMenuCommand
  12. // @license GPL
  13. // ==/UserScript==
  14. (function() {
  15. 'use strict';
  16. const target = document.evaluate('/html/body/div[1]/div[2]/div[2]/div[2]/div[1]/text()[2]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
  17. if (target) {
  18. target.textContent = "享受 宁 的快乐!";
  19. }
  20. })();
  21. (function() {var css = "";
  22. css += [
  23. "[data-v-e5ad98f0][data-v-f9624136]{",
  24. " display:block !important;",
  25. "}",
  26. ].join("\n");
  27. if (typeof GM_addStyle != "undefined") {
  28. GM_addStyle(css);
  29. } else if (typeof PRO_addStyle != "undefined") {
  30. PRO_addStyle(css);
  31. } else if (typeof addStyle != "undefined") {
  32. addStyle(css);
  33. } else {
  34. var node = document.createElement("style");
  35. node.type = "text/css";
  36. node.appendChild(document.createTextNode(css));
  37. var heads = document.getElementsByTagName("head");
  38. if (heads.length > 0) {
  39. heads[0].appendChild(node);
  40. } else {
  41. // no head yet, stick it whereever
  42. document.documentElement.appendChild(node);
  43. }
  44. }
  45. })();
  46. function Again()
  47. {
  48. var css = GM_getValue("css");
  49. document.querySelector('main[style="background-color: rgb(239, 239, 239);"]').style=css;
  50. }
  51. window.onload=function(){
  52. var config = GM_getValue("config");
  53. if(GM_getValue("config")==null) {
  54. config=1
  55. GM_setValue("config",config);
  56. GM_setValue("css","background-color: rgb(239, 239, 239);");
  57. }
  58. GM_registerMenuCommand("设置背景CSS",function(){
  59. var css = GM_getValue("css");
  60. css=prompt("Please give us your CSS:","");
  61. GM_setValue("css",css);
  62. alert("OK!");
  63. });
  64. Again();
  65. setTimeout(function(){
  66. Again();
  67. }, 2000);
  68. };

QingJ © 2025

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