回到首页

浏览器配置链接直接跳转和屏蔽知乎登陆弹窗

用到了Tampermonkey插件,安装知乎屏蔽登录弹窗脚本直接外链跳转脚本

安装好知乎屏蔽登录弹窗脚本打开编辑,前几行的配置说明项中一行match的值改为"https://*.zhihu.com/*"

屏蔽网页中的元素

例如屏蔽百度百科中的介绍视频元素,创建油猴脚本如下:

// ==UserScript==
// @name         block some elements I don't like
// @namespace    https://baidu.com
// @version      0.1
// @description  屏蔽网站中不想看到的元素
// @author       You
// @match        https://baike.baidu.com/*
// @match        https://jingyan.baidu.com/*
// @license      GPLv3 License
// ==/UserScript==

(function() {
    'use strict';
    var baiduBaikeVideoElement = document.getElementById("sl-player-el");
    var baiduJingyanVideoElement = document.getElementById("feeds-video-play-container");
    if(baiduBaikeVideoElement)baiduBaikeVideoElement.style.display = "none";
    if(baiduJingyanVideoElement)baiduJingyanVideoElement.style.display = "none";
    // Your code here...
})();

参考链接:如何在PC端浏览器屏蔽知乎登录弹窗?告别麻烦的外链跳转,你只需要一个油猴脚本

节选自:自定义浏览器扩展屏蔽百度百科自动播放视频

本文创建于2021年 07月 09日 星期五 16:02:36 CST,修改于2021年7月19日10点52分