1 cookie0402 OP 写了脚本,但是每次都得手动去控制台运行 |
![]() | 2 fengci 2024-08-14 15:12:32 +08:00 你说的不就是 油猴子 嘛 |
![]() | 3 chu1337 2024-08-14 15:16:16 +08:00 油猴。 |
![]() | 4 flysp 2024-08-14 15:44:26 +08:00 我自己的百度屏蔽规则 baidu.com##div[class="result-op xpath-log"] baidu.com##div[id="content_right"] baidu.com###content_right baidu.com##.cr-offset baidu.com##.title-content.c-link.c-font-medium.c-line-clamp1 baidu.com##.title-text.c-font-medium.c-color-t baidu.com##.s-hotsearch-title baidu.com##.tieba-custom-pass-login baidu.com##div[class="result-op xpath-log"] baidu.com##div[id="content_right"] baidu.com###content_right baidu.com##.cr-offset baidu.com##.title-content.c-link.c-font-medium.c-line-clamp1 baidu.com##.title-text.c-font-medium.c-color-t baidu.com##.s-hotsearch-title baidu.com##.tieba-custom-pass-login baidu.com##div[class="s-isindex-wrap"] |
5 cookie0402 OP @flysp 也是用的油猴吗,我刚刚下载了油猴,发现添加的脚本一直没运行,是啥原因 |
6 cookie0402 OP @flysp 这个是我的代码(function() { 'use strict'; // Your code here... var doe = document.getElementById("content_right") doe.style.display = 'none' console.log("qidong") })(); |
![]() | 7 pipaseqin 2024-08-14 15:56:51 +08:00 这是隐藏知乎标题的,供参考下。 ``` // ==UserScript== // @name ZhiHu // @namespace http://tampermonkey.net/ // @version 2024-08-14 // @description try to take over the world! // @author You // @match https://www.zhihu.com/question/* // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant none // @require https://code.jquery.com/jquery-3.7.1.min.js // ==/UserScript== /* globals jQuery, $, waitForKeyElements */ (function() { 'use strict'; $(window).scroll(function() { if($('.QuestionHeader-title').length) { $('.QuestionHeader-title').css('display', 'none'); } }); })(); ``` |
![]() | 8 Mechanical 2024-08-14 16:12:22 +08:00 用 adblock 插件更容易实现,针对性屏蔽页面元素 |
![]() | 9 yhxx 2024-08-14 16:17:12 +08:00 这个需求甚至可以直接用 stylebot 之类的改一下 css 就行了 |
10 cookie0402 OP @Mechanical 这个好像要收费 |
![]() | 11 flysp 2024-08-14 16:39:46 +08:00 @cookie0402 用的 Adblock 插件,配置 F12 查看页面元素,可以自定义屏蔽很多广告 |