Greasy Fork 还支持 简体中文。

DevRant-MOD

Useful MODs for DevRant

目前為 2017-07-19 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name DevRant-MOD
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Useful MODs for DevRant
  6. // @author Himalay
  7. // @match https://www.devrant.io/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. "use strict";
  13. document.querySelector("style").innerHTML += `* {
  14. user-select: text !important;
  15. -moz-user-select: text !important;
  16. -webkit-user-select: text !important;
  17. }
  18. .rant-lightbox {
  19. position: fixed;
  20. top: 0;
  21. left: 0;
  22. width: 100%;
  23. height: 100%;
  24. background: rgba(0, 0, 0, 0.8);
  25. display: flex;
  26. align-items: center;
  27. justify-content: center;
  28. flex-direction: column;
  29. z-index: 9999;
  30. padding: 10px;
  31. }
  32. .rant-lightbox img {
  33. max-height: 90vh;
  34. }
  35. .rant-lightbox a {
  36. margin-top: 10px;
  37. font-size: 1.5em;
  38. }`;
  39. document.addEventListener("click", e => {
  40. if (e.target.parentElement.classList.contains("rant-image")) {
  41. document.body.innerHTML += `<div class="rant-lightbox" onclick="this.parentElement.removeChild(this);"><img src="${e
  42. .target.src}" /><a href="${e.target
  43. .src}" download="${e.target.src.split("/").pop()}">?</a></div>`;
  44. e.preventDefault();
  45. e.stopPropagation();
  46. }
  47. });
  48. })();