【问题标题】:How to remove or hide every <p class="description"> and the border-bottom thing with tampermonkey?如何使用 Tampermonkey 删除或隐藏每个 <p class="description"> 和边框底部的东西?
【发布时间】:2021-12-03 17:13:41
【问题描述】:

我是脚本、html、css 方面的新手。基本上只是对它一无所知。 (如果我遗漏了一些标签,我很抱歉。D:)

我正在尝试制作一个脚本来删除/隐藏描述和边框底部 1 周,但仍然没有进展。 (这是一个名为 sploop.io 的浏览器游戏,我想让帽子菜单看起来更好。)

图片:&lt;p class="description"&gt; => https://imgur.com/5Sbdbg3,边框底部 => https://imgur.com/XJQuPPV

// ==UserScript==
// @name         Sploop.io Better Hat Menu
// @version      0.1
// @description  Better Hat Menu
// @author       s
// @match        https://sploop.io/
// @icon         none
// @grant        none
// ==/UserScript==

(function() {
'use strict';

document.getElementById('da-left').style = "display:none;"
document.getElementById('da-right').style = "display:none;"
document.getElementById('bottom-content').style = "display:none;"
document.getElementById('alsoTryLink').style = "display:none;"
document.getElementById('cross-promo').style = "display:none;"
document.getElementById('google_play').style = "display:none;"
document.getElementById('iogames').style = "display:none;"
document.getElementById("hat-menu").style = "display: flex; opacity: 1; height: 320px; width: 400px; box-shadow: 0px 0px; border: 0px solid; border-radius: 0px; box-sizing: border-box; background: rgba(40, 45, 34, 0.3);";
document.getElementById("hat_menu_content").style = "width: 400px; background: rgb(20 20 20 / 0%); box-shadow: inset 0 5px 0 rgb(20 20 20 / 0%); margin: 20px 0 0px 0; border: 0px solid #141414";

})();

这是我现在用于帽子菜单的代码,我只需要删除/隐藏描述和边框底部的东西就完成了,但我不知道如何制作,所以我来到这里并就如何删除/隐藏它们寻求帮助。

【问题讨论】:

  • 您好,请将文本形式的代码附加到您的帖子中

标签: tampermonkey userscripts


【解决方案1】:

只需执行以下操作:

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://sploop.io/
// @icon         https://www.google.com/s2/favicons?domain=sploop.io
// @grant        GM_addStyle
// @run-at       document-start
// ==/UserScript==

GM_addStyle(`
  .description {
    visibility: hidden !important;
  }

  .menu-item {
    border-bottom: none !important;
  }
`);

参考:https://stackoverflow.com/a/19392142/11613622

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-02-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多