Greasy Fork

Greasy Fork is available in English.

心平气和看虎扑

2023/4/23 02:31:41

当前为 2023-04-24 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        心平气和看虎扑
// @namespace   Violentmonkey Scripts
// @match       https://bbs.hupu.com/*.html
// @license MIT
// @grant       none
// @version     1.11
// @author      -
// @description 2023/4/23 02:31:41
// ==/UserScript==



var containers = document.querySelectorAll(".wrapper-container");

for (let i = 1; i < containers.length; i++) {
  containers[i].style.display = 'none';
}


var replies = document.querySelectorAll(".post-reply-list-operate");

for (let i = 0; i < replies.length; i++) {
  replies[i].style.display = 'none';
}

// 屏蔽湿乎乎这个傻逼官方引战区:
var wholeScreen = document.querySelector("#__next");




var title = document.querySelector(".index_br__hJajv");
var section = title.querySelector(".index_hp-pc-breadcrumb___Sojb");

var children = section.querySelectorAll("span");


for (let child of children) {
  if (child.textContent === "湿乎乎的话题 » ") {
      
        const htmlString = `
<div>
  <h3>珍惜生命</h3>
  <h3>远离官方引战区</h3>
  <button>
    <a href="https://bbs.hupu.com/"> 回到首页 </a>
  </button>
  <div style="color:white">
   ${setTimeout(function() {
      window.location.href = 'https://bbs.hupu.com/';
    }, 5000)}
  </div>
</div>
`

      wholeScreen.innerHTML =htmlString;
      wholeScreen.style.width = '200px'; // set the width of the element
      wholeScreen.style.margin = 'auto'; // set the margin to auto to center horizontally and vertically

  }
}