oo.pe redirection remover

remove oo.pe redirection in Arca.live

安装此脚本
作者推荐脚本

您可能也喜欢Arca base64 autodecoder

安装此脚本
  1. // ==UserScript==
  2. // @name oo.pe redirection remover
  3. // @name:ko oo.pe 리디렉션 제거기
  4. // @namespace OOPE_REMOVER_V1
  5. // @match https://arca.live/b/*
  6. // @run-at document-end
  7. // @version 1.24
  8. // @author Laria
  9. // @description remove oo.pe redirection in Arca.live
  10. // @description:ko 아카라이브 oo.pe 리디렉션을 제거합니다.
  11. // @supportURL https://gf.qytechs.cn/scripts/485591
  12. // @icon https://www.google.com/s2/favicons?sz=64&domain=oo.pe
  13. // @license MIT
  14. // @encoding utf-8
  15. // ==/UserScript==
  16.  
  17. /*
  18. * Note: Please install with greasyfork, it will update automatically..
  19. *
  20. * More info. https://gf.qytechs.cn/scripts/485591
  21. *
  22. */
  23.  
  24. /*
  25. * == Change log ==
  26. * 1.0 - release
  27. * 1.1 - add retry
  28. * 1.2 - detect comment reload
  29. * 1.21 - apply link's description
  30. * 1.22 - check article comment before register event listner, retry 7 -> 10
  31. * 1.23 - add site:unsafelink(unsafelink.com)
  32. * 1.24 - remove all listener on exrenal link (to remove redirection modal)
  33. */
  34.  
  35. //root
  36. (function() {
  37. 'use strict';
  38.  
  39. //target list
  40. const targetList = [
  41. 'oo.pe',
  42. 'unsafelink.com', //added in 1.23
  43. ];
  44.  
  45. function resolveLink(tar = 'all') {
  46. function _resolveLink(_container, _link) {
  47. function _res(_tar) {
  48. //tokenizing
  49. const token = _tar.split('/');
  50. //search oo.pe prefix
  51. const pref = token.indexOf(_link);
  52. //join link after prefix
  53. return token.slice(pref + 1).join('/');
  54. }
  55. //search link include 'oo.pe'
  56. _container.querySelectorAll(`a[href*="${_link}"]`).forEach(function(src) {
  57. try {
  58. src.title = _res(src.title);
  59. src.href = _res(src.href);
  60. } catch (_) {}
  61. });
  62. //remove popup modal listner
  63. _container.querySelectorAll('a.external').forEach((_tar)=>{
  64. _tar.parentNode.replaceChild(_tar.cloneNode(true), _tar);
  65. });
  66.  
  67. }
  68. //no target -> body and comment
  69. if(tar == 'all') {
  70. resolveLink('.article-body');
  71. resolveLink('.article-comment');
  72. } else {
  73. //try to resolve registered link
  74. targetList.forEach((_tarLink)=>{_resolveLink(document.querySelector(tar), _tarLink);});
  75. }
  76. }
  77. //try entire
  78. resolveLink();
  79.  
  80. //repeat resolve
  81. setTimeout(() => {
  82. resolveLink();
  83. }, 50);
  84.  
  85. //add event listner when refresh comment after 0.2sec
  86. setTimeout(() => {
  87. resolveLink();
  88. if(document.querySelector('.article-comment')) {
  89. //resolve link when comment reload
  90. document.querySelector('.article-comment').querySelector('.newcomment-alert').addEventListener('click', (event) => {
  91. event.preventDefault();
  92. //try to resole while server connection pending (1000ms)
  93. for (let i = 1; i <= 10; i++) {
  94. setTimeout(() => {
  95. resolveLink('.article-comment');
  96. }, 100 * i);
  97. }
  98. });
  99. }
  100. }, 200);
  101. })();

QingJ © 2025

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