🏠 返回首頁 

Greasy Fork is available in English.

天幻 FF1 专题 - 宽屏优化

大屏优化 - 图片展开、强制插入图片。


Installer dette script?
  1. // ==UserScript==
  2. // @name 天幻 FF1 专题 - 宽屏优化
  3. // @namespace moe.jixun
  4. // @version 0.1
  5. // @description 大屏优化 - 图片展开、强制插入图片。
  6. // @author Jixun
  7. // @include http://ff1.ffsky.cn/*
  8. // @grant none
  9. // ==/UserScript==
  10. (function() {
  11. 'use strict';
  12. const style = document.createElement("style");
  13. style.textContent = `
  14. #wrapper, #content, #content-box { width: initial }
  15. #content-box {
  16. position: absolute;
  17. left: 200px;
  18. }
  19. html, body {
  20. background:#fff;
  21. margin: 0;
  22. }
  23. #footer {
  24. display: none;
  25. }
  26. `;
  27. document.head.appendChild(style);
  28. const links = document.getElementsByTagName("a");
  29. [].forEach.call(links, link => {
  30. if (link.textContent.includes("分辨率")) {
  31. const m = link.textContent.match(/分辨率:(\d+)[*x](\d+)/);
  32. link.textContent = '';
  33. if (link.href.endsWith(".htm")) {
  34. const frame = document.createElement("iframe");
  35. frame.style.border = 0;
  36. frame.src = link.href;
  37. frame.width = parseInt(m[1]) + 16;
  38. frame.height = parseInt(m[2]) + 16;
  39. link.parentNode.insertBefore(frame, link);
  40. } else {
  41. const img = document.createElement("img");
  42. img.src = link.href;
  43. link.appendChild(img);
  44. }
  45. }
  46. });
  47. })();