目录

工欲善其事

实践出真知

活跃标签: linux java mysql 待分类 js springboot win10 电路 vue macOS nginx esp32 git docker windows idea maven esp8266 python Arduino

存档:

让多此一举的页面自动跳转的油猴脚本

  • 1、需要安装油猴插件
  • 2、添加以下脚本
// ==UserScript==
// @name         自动跳转
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @include      *://link.csdn.net/*
// @include      *://link.zhihu.com/*
// @include      *://gitee.com/link*
// @include      *://www.jianshu.com/go-wild*
// @author       You
// @icon         https://www.google.com/s2/favicons?sz=64&domain=csdn.net
// @grant        none
// @run-at document-end
// ==/UserScript==


window.addEventListener('load', (event) => {
    location.href = {
        'link.csdn.net': () => document.getElementsByClassName('loading-btn')[0].href ,
        'www.jianshu.com': () => {
            // body...
            var wordDiv = null
            let divs = document.getElementsByTagName('div')
            for (var i = divs.length - 1; i >= 0; i--) {
                if (divs[i].innerText == '安全性未知,是否继续') {
                    wordDiv = divs[i]
                    return divs[i].nextElementSibling.innerText
                }
            }
        },
        'link.zhihu.com': () => document.getElementsByClassName('link')[0].innerText ,
	'gitee.com':() => document.getElementsByClassName('external-link-href')[0].innerText
    }[location.host]()
});

标题:让多此一举的页面自动跳转的油猴脚本
作者:llilei
地址:http://solo.llilei.work/articles/2022/11/11/1668153196623.html