您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
直接跳转知乎和简书的外链
当前为
// ==UserScript==ww // @name 直接跳转知乎、简书的外链 // @namespace https://github.com/XanderWang // @version 0.1.0 // @description 直接跳转知乎和简书的外链 // @author XanderWang // @icon https://i.loli.net/2020/05/29/DxSmHAy2o53FdUY.png // @match *://*.shiyanlou.com/* // @match *://*.jianshu.com/* // @match *://*.zhihu.com/* // @match *://*.csdn.net/* // @match *://*.imooc.com/* // @grant none // ==/UserScript== (function() { 'use strict'; // Your code here... function addLink(e) { e.preventDefault() var pagelink = '\nRead more: ' + document.location.href var copytext = window.getSelection() var clipdata = e.clipboardData || window.clipboardData if (clipdata) { clipdata.setData('Text', copytext) } } document.addEventListener('copy', addLink) function jumpUrl() { /// 获取所有 a 标签 var documents = document.getElementsByTagName("a"); for (var i = 0; i < documents.length; i++) { var _href = decodeURIComponent(documents[i].href) var _hrefArrays = _href.split("http") if( _hrefArrays.length == 3 ) { var realHref = "http" + _hrefArrays[2] console.log('ori', _href, 'real', realHref) documents[i].href = realHref } // if(_href.indexOf("link.jianshu.com") != -1) { // documents[i].href = decodeURIComponent(_href.split("?t=")[1]) // } else if(_href.indexOf("link.zhihu.com") != -1) { // documents[i].href = decodeURIComponent(_href.split("target==")[1]) // } } } jumpUrl(); window.onscroll = function() { setTimeout(function() { jumpUrl() }, 500) } })();