Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

链接地址洗白白书签 幸福的赢得版 #422

Open
xfdyd opened this issue Jan 31, 2023 · 6 comments
Open

链接地址洗白白书签 幸福的赢得版 #422

xfdyd opened this issue Jan 31, 2023 · 6 comments

Comments

@xfdyd
Copy link
Owner

xfdyd commented Jan 31, 2023

下载(自动版较旧):
链接地址洗白白脚本.zip

更新日志:

2023.1.31 增加了对微信公众号地址的支持,解决了在以下这类地址的bug:
https://www.bilibili.com/festival/city?bvid=BV1pM411C7ys&spm_id_from=333.999.0.0

4.14 增加支持:
https://m.baidu.com/video/page?pd=video_page&nid=3893992658508307601&sign=11860350228752187206&word=%E7%87%83%E6%B0%94%E7%83%AD%E6%B0%B4%E5%99%A8%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%E6%97%B6%E5%8F%AF%E4%BB%A5%E8%B0%83%E8%8A%82%E7%81%AB%E5%8A%9B%E5%90%97&oword=%E7%87%83%E6%B0%94%E7%83%AD%E6%B0%B4%E5%99%A8%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%E6%97%B6%E5%8F%AF%E4%BB%A5%E8%B0%83%E8%8A%82%E7%81%AB%E5%8A%9B%E5%90%97&atn=index&frsrcid=48304&ext=%7B%22jsy%22%3A1%7D&top=%7B%22sfhs%22%3A1%2C%22_hold%22%3A2%7D&fr0=A&fr1=A&ms=1&lid=9604468640024136773&referlid=9604468640024136773&frorder=10&_t=1681440025619

5.30 增加支持:
https://image.baidu.com/search/detail?ct=503316480&z=0&ipn=d&word=%E7%A9%BA%E8%B0%83%E9%81%A5%E6%8E%A7%E5%99%A8%E5%9B%BE%E6%A0%87%20%E7%BE%8E%E7%9A%84&hs=0&pn=2&spn=0&di=7214885350303334401&pi=0&rn=1&tn=baiduimagedetail&is=0%2C0&ie=utf-8&oe=utf-8&cl=2&lm=-1&cs=3474475403%2C2521081824&os=3641782296%2C2257729948&simid=4227882712%2C720049647&adpicid=0&lpn=0&ln=30&fr=ala&fm=&sme=&cg=&bdtype=0&oriquery=%E7%A9%BA%E8%B0%83%E9%81%A5%E6%8E%A7%E5%99%A8%E5%9B%BE%E6%A0%87%20%E7%BE%8E%E7%9A%84&objurl=https%3A%2F%2Fgss0.baidu.com%2F-vo3dSag_xI4khGko9WTAnF6hhy%2Fzhidao%2Fpic%2Fitem%2Fd788d43f8794a4c2e0d2e31e0df41bd5ad6e3915.jpg&fromurl=ippr_z2C%24qAzdH3FAzdH3Fzit1w5_z%26e3Bkwt17_z%26e3Bv54AzdH3Fq7jfpt5gAzdH3F8c9abcdcan9nacbm9d0_z%26e3Bip4s&gsm=&islist=&querylist=&dyTabStr=MCwzLDQsMSw2LDUsNyw4LDIsOQ%3D%3D

2024.4.23 同步其油猴脚本更新,细节优化。

@xfdyd
Copy link
Owner Author

xfdyd commented Jan 31, 2023

使用方法就是Firefox上创建一个书签,编辑书签,复制代码粘贴到网址栏,保存。

@xfdyd
Copy link
Owner Author

xfdyd commented Jan 31, 2023

应该是可靠的,当然我并不是真的懂。这个脚本其他地址可能失败的问题我也没有修复。

@xfdyd
Copy link
Owner Author

xfdyd commented Jan 31, 2023

手机上kiwi浏览器也可以用,随便保存个书签,然后编辑书签,把它的地址改成上面文件中的代码。在需要使用的页面地址栏输入书签名称打开即可。去书签栏里面点击是无效的。

@xfdyd
Copy link
Owner Author

xfdyd commented Feb 2, 2023

链接地址洗白白 原版官网:
https://dmscode.github.io/Link-cleaner/

@xfdyd xfdyd changed the title 链接地址洗白白书签 幸福的赢得改进版 链接地址洗白白书签 幸福的赢得版 Feb 2, 2023
@xfdyd
Copy link
Owner Author

xfdyd commented Jul 14, 2024

自动版油猴脚本:

@xfdyd
Copy link
Owner Author

xfdyd commented Jul 14, 2024

// ==UserScript==
// @name 链接地址洗白白自动版
// @namespace Daomouse Link Cleaner
// @Version 0.1.14
// @author 稻米鼠
// @description 把链接地址缩减至最短可用状态,并复制到剪切板,以方便分享。【在每个页面的底部中间,有一个小小的按钮,用来呼出面板】
// @ICON https://i.v2ex.co/vpQpSrfgl.png
// @homepage https://script.izyx.xyz/clean-the-link/
// @updateURL
// @downloadurl
// @supportURL https://meta.appinn.com/t/7363

// @match .douyin.com/
// @match .iesdouyin.com/
// @match .ixigua.com/
// @match .inews.qq.com/
// match .zhihu.com/
// @exclude ://www.zhihu.com/search?

// @match ://image.baidu.com/search/detail
// @match ://m.baidu.com/video
// match ://.bilibili.com/*
// @match ://www.youtube.com/watch
// @include /^https?://apps.apple.com/(?:\w{2}/)?([^\/]+)/(?:[^\/]+/)?((?:id)\d+)
// @include /^http(?:s)?://www.microsoft.com/[a-zA-Z-]{2,5}/p/[^/]+/([a-zA-Z0-9]{12,})(?:[^a-zA-Z0-9]
// @include /^http(?:s)?://chrome.google.com/webstore/detail/[^\/]+/([a-z]{32})
// @include /^http(?:s)?://s.taobao.com/search
// @include /^http(?:s)?://list.tmall.com/search_product.htm
// @include /^http(?:s)?://item.taobao.com/item.htm
// @include /^http(?:s)?://detail.tmall.com/item.htm
// @include /^http(?:s)?://(\w+).(taobao|tmall).com/shop/view_shop.htm
// @include /^http(?:s)?://c.pc.qq.com/middle.html?.pfurl=
// @include ^http(?:s)?://item.m.jd.com/product/(\d+).html
// @include /^http(?:s)?://item.m.jd.com/ware/view.action?.wareId=(\d+)
// @include /^http(?:s)?://search.jd.com/Search?
// @include /^http(?:s)?://re.jd.com/cps/item/(\d+).html
// @include /^http(?:s)?://(?:www.)?weibo.com/u/(\d+)(?.
)?
// @include /^http(?:s)?://(?:www.)?weibo.com/(?:\d+)/(\w+)(?.
)?
// @match ://greasyfork.org/
// @include /^http(?:s)?://(store.steampowered|steamcommunity).com/app/(\d+)
// @include /^http(?:s)?://meta.appinn.net/t(?:/[^/])?/(\d+)(/.$|$)
// @include /^http(?:s)?://(?:www.)?amazon.co.jp/([^\/]+)/dp/(\w+)/
// @include /^http(?:s)?://(?:www.)?amazon.com/([^\/]+)/dp/(\w+)/
// @include /^http(?:s)?://mobile.yangkeduo.com/goods.html?
// @include /^http(?:s)?://(?:www.)?trello.com/(\w)/(\w+)(/.
$|$)
// @include /^http(?:s)?://detail.1688.com/offer/(\d+).html?
// @include /^http(?:s)?://mp.weixin.qq.com/s?
// @match ://.sohu.com/*

// @grant GM_setClipboard
// @grant GM_notification
// @grant GM_addStyle
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_registerMenuCommand
// @Noframes
// @downloadurl https://update.greasyfork.org/scripts/373270/%E9%93%BE%E6%8E%A5%E5%9C%B0%E5%9D%80%E6%B4%97%E7%99%BD%E7%99%BD.user.js
// @updateURL https://update.greasyfork.org/scripts/373270/%E9%93%BE%E6%8E%A5%E5%9C%B0%E5%9D%80%E6%B4%97%E7%99%BD%E7%99%BD.meta.js
// ==/UserScript==

/**

  • 声明:本页面代码未作任何压缩处理
  • 但不意味着作者允许任何形式的——
  • 借用、抄袭、修改……
  • 未经作者允许,仅有权使用,及分享
  • 且分享必须在鲜明位置给出本脚本在
  • Greasemonkey 中的发布地址
  • 作者未授权任何其他网站提供下载!
  • 开源不等于任君自取,自重!!!
    */

/** 主功能函数 **/

/**

  • 链接净化规则
  • version 0.0.5
  • update 2020-09-01 07:07:37
    /
    const rules = {
    'image.baidu.com/search/detail':{
    testReg:/^(http(?:s)?://image.baidu.com/search/detail[^?#]
    )[?#].$/i,
    query:['word','pn','tn']
    },
    'm.baidu.com/video':{
    testReg:/^(http(?:s)?://m.baidu.com/video[^?#]
    )[?#].$/i,
    query:['sign','word','atn']
    },
    'www.bilibili.com': {/
    Bilibili /
    testReg: /^http(?:s)?://www.bilibili.com/video/((av|bv).
    ?)/.$/i,
    replace: 'https://www.bilibili.com/$1',
    query:['p'],
    hash: true
    },
    'www.bilibili.com/festival/city':{/
    Bilibili /
    testReg:/^(http(?:s)?://www.bilibili.com/festival/city[^?#]
    )[?#].$/i,
    query:['bvid']
    },
    'www.youtube.com': {/
    YouTube /
    testReg: /^http(?:s)?://www.youtube.com/watch?.
    $/i,
    replace: 'https://www.youtube.com/watch',
    query: ['v', 'list'],
    hash: true
    },
    'itunes.apple.com': {/* Apple Store /
    testReg: /^http(?:s)?://itunes.apple.com/(?:\w{2}/)?([^\/]+)/(?:[^\/]+/)?((?:id)\d+).
    $/i,
    replace: 'https://itunes.apple.com/cn/$1/$2',
    },
    'apps.apple.com': {/* Apple Stroe /
    testReg: /^http(?:s)?://apps.apple.com/(?:\w{2}/)?([^\/]+)/(?:[^\/]+/)?((?:id)\d+).
    $/i,
    replace: 'https://apps.apple.com/cn/$1/$2',
    },
    'microsoft.com/win10-store': {/* Win10 apps store /
    testReg: /^http(?:s)?://www.microsoft.com/[a-zA-Z-]{2,5}/p/[^/]+/([a-zA-Z0-9]{12,})(?:[^a-zA-Z0-9].
    |$)/i,
    replace: 'https://www.microsoft.com/store/apps/$1',
    },
    'chrome.google.com/webstore': {/* Chrome Store /
    testReg: /^http(?:s)?://chrome.google.com/webstore/detail/[^\/]+/([a-z]{32}).
    /i,
    replace: 'https://chrome.google.com/webstore/detail/$1',
    },
    's.taobao.com': {/* Taobao Search /
    testReg: /^http(?:s)?://s.taobao.com/search.
    $/i,
    replace: 'https://s.taobao.com/search',
    query: ['q'],
    },
    'list.tmall.com': {/* Tmall Search /
    testReg: /^http(?:s)?://list.tmall.com/search_product.htm.
    $/i,
    replace: 'https://list.tmall.com/search_product.htm',
    query: ['q'],
    },
    'item.taobao.com': {/* Taobao item /
    testReg: /^http(?:s)?://item.taobao.com/item.htm.
    $/i,
    replace: 'https://item.taobao.com/item.htm',
    query: ['id'],
    },
    'detail.tmall.com': {/* Tmall item /
    testReg: /^http(?:s)?://detail.tmall.com/item.htm.
    $/i,
    replace: 'https://detail.tmall.com/item.htm',
    query: ['id'],
    },
    'taobao/tmall.com/shop': {/* Taobao/Tmall Shop /
    testReg: /^http(?:s)?://(\w+).(taobao|tmall).com/shop/view_shop.htm.
    $/i,
    replace: 'https://$1.$2.com/',
    },
    'c.pc.qq.com': {/* Open Taobao share link from QQ /
    testReg: /^http(?:s)?://c.pc.qq.com/middle.html?.pfurl=([^&])(?:&.
    $|$)/i,
    replace: '$1',
    query: [],
    methods: ['decodeUrl'],
    },
    'item.m.jd.com': {/* JD mobile to PC /
    testReg: /^http(?:s)?://item.m.jd.com/product/(\d+).html(?.
    )?$/i,
    replace: 'https://item.jd.com/$1.html',
    },
    'item.m.jd.com/ware/': {/* JD mobile to PC /
    testReg: /^http(?:s)?://item.m.jd.com/ware/view.action?.wareId=(\d+).$/i,
    replace: 'https://item.jd.com/$1.html',
    },
    'search.jd.com': {/
    JD Search /
    testReg: /^http(?:s)?://search.jd.com/Search?.
    $/i,
    query: ['keyword', 'enc'],
    },
    're.jd.com': {/* JD hot sell /
    testReg: /^http(?:s)?://re.jd.com/cps/item/(\d+).html.
    $/i,
    replace: 'https://item.jd.com/$1.html',
    },
    'weibo.com/u': {/* Weibo personal homepage to mobile /
    testReg: /^http(?:s)?://(?:www.)?weibo.com/u/(\d+)(?.
    )?$/i,
    replace: 'https://m.weibo.cn/$1',
    },
    'weibo.com': {/* Weibo article page to mobile /
    testReg: /^http(?:s)?://(?:www.)?weibo.com/(?:\d+)/(\w+)(?.
    )?$/i,
    replace: 'https://m.weibo.cn/status/$1',
    },
    'greasyfork.org/script/tabs': {/* Greasyfork Script 脚本下各种标签 /
    testReg: /^http(?:s)?://(?:www.)?greasyfork.org/(?:[\w-]
    /)?scripts/(\d+)-[^//]/(code|versions|stats|derivatives|admin).$/i,
    replace: 'https://greasyfork.org/scripts/$1/$2',
    query: ['version'],
    hash: true
    },
    'greasyfork.org': {/* Greasyfork Script 各类页面 /
    testReg: /^http(?:s)?://(?:www.)?greasyfork.org/(?:[\w-]
    /)?(scripts|users)/(\d+)-[^//]$/i,
    replace: 'https://greasyfork.org/$1/$2',
    },
    'greasyfork.org/scripts/list': {/
    Greasyfork Script 脚本列表 /
    testReg: /^http(?:s)?://(?:www.)?greasyfork.org/(?:[\w-]
    /)?scripts?.$/i,
    query: ['set', 'page']
    },
    'greasyfork.org/script/discussions': {/
    Greasyfork Script 脚本下讨论 /
    testReg: /^http(?:s)?://(?:www.)?greasyfork.org/(?:[\w-]
    /)?scripts/(\d+)-[^//]/discussions/(\d+).$/i,
    replace: 'https://greasyfork.org/scripts/$1/discussions/$2',
    hash: true
    },
    'greasyfork.org/discussions': {/* Greasyfork Script 论坛 /
    testReg: /^http(?:s)?://(?:www.)?greasyfork.org/(?:[\w-]
    /)?discussions/(greasyfork|development|requests)/(\d+)(?:[^\d].)?$/i,
    replace: 'https://greasyfork.org/discussions/$1/$2',
    hash: true
    },
    'store.steampowered.com|steamcommunity.com': {/
    Steam /
    testReg: /^http(?:s)?://(store.steampowered|steamcommunity).com/app/(\d+).
    $/i,
    replace: 'https://$1.com/app/$2',
    },
    'meta.appinn.com': {/* Appinn BBS /
    testReg: /^http(?:s)?://meta.appinn.net/t(?:/[^/]
    )?/(\d+)(/.$|$)/i,
    replace: 'https://meta.appinn.net/t/$1',
    },
    'amazon.co.jp': {/* amazon.co.jp /
    testReg: /^http(?:s)?://(?:www.)?amazon.co.jp/([^\/]+)/dp/(\w+)/.
    $/i,
    replace: 'https://www.amazon.co.jp/$1/dp/$2',
    },
    'amazon.com': {/* amazon.com by @zj1123581321 1688 商品详情页网址净化 dmscode/Link-cleaner#10 /
    testReg: /^http(?:s)?://(?:www.)?amazon.com/([^\/]+)/dp/(\w+)/.
    $/i,
    replace: 'https://www.amazon.com/$1/dp/$2',
    },
    'yangkeduo.com': {/* Pin Duo Duo product Page /
    testReg: /^http(?:s)?://mobile.yangkeduo.com/goods.html?.
    $/i,
    query: ['goods_id'],
    },
    'trello.com': {/* trello.com /
    testReg: /^http(?:s)?://(?:www.)?trello.com/(\w)/(\w+)(/.
    $|$)/i,
    replace: 'https://trello.com/$1/$2',
    hash: true,
    },
    'detail.1688.com/offer': {/* item detail on 1688 by @zj1123581321 1688 商品详情页网址净化 dmscode/Link-cleaner#10 /
    testReg: /^http(?:s)?://detail.1688.com/offer/(\d+).html?.
    $/i,
    replace: 'https://detail.1688.com/offer/$1.html',
    },
    'mp.weixin.qq.com':{
    testReg:/^http(?:s)?://mp.weixin.qq.com/s?.$/i,
    query:['__biz','idx','mid','sn','src','timestamp','ver','signature']
    },
    'other': {/
    All url /
    testReg: /^(http(?:s)?://[^?#]
    )[?#].*$/i,
    query: ['id', 'tid', 'uid', 'q', 'wd', 'query', 'keyword', 'keywords'],
    }
    }
    /**
  • 主功能代码
  • version 0.0.1
  • update 2018-10-15 08:00:00
    /
    function dms_get_pure_url (url=window.location.href) {
    const hash = url.replace(/^[^#]
    (#.)?$/, '$1')
    const base = url.replace(/(?|#).
    $/, '')
    let pureUrl = url
    const getQueryString = function(key) {
    let ret = url.match(new RegExp('(?:\?|&)(' + key + '=[^?#&])', 'i'))
    return ret === null ? '' : ret[1]
    }
    /
    链接处理方法 /
    const methods = {
    decodeUrl: function(url){return decodeURIComponent(url) }
    }
    for(let i in rules){
    let rule = rules[i]
    let reg = rule.testReg
    let replace = rule.replace
    if (reg.test(url)){
    let newQuerys = ''
    if(typeof(rule.query)!=='undefined' && rule.query.length>0){
    rule.query.map((query) => {
    const ret = getQueryString(query)
    if(ret !== ''){
    newQuerys += (newQuerys.length ? '&' : '?') + ret
    }
    })
    }
    newQuerys += typeof(rule.hash)!=='undefined' && rule.hash
    ? hash
    : ''
    pureUrl = (typeof(replace)==='undefined'?base:url.replace(reg, replace) ) + newQuerys
    if(typeof(rule.methods)!=='undefined' && rule.methods.length>0){
    rule.methods.map((methodName)=>{
    pureUrl = methodsmethodName
    })
    }
    break
    }
    }
    return pureUrl
    }
    /
    * 必须函数 /
    /
    弹出通知 /
    const dmsCLNotification = function (text) {
    GM_notification(text, 'Success! by 链接地址洗白白', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAASyElEQVR4nO2de3AU1Z7H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PiH0BoYQozfQDxoCQhy3IP4M+oHDtXX1/fza6JGivEuPjfAK9LknTBtI5WDAAgy/JVwH+gcfSsk8PDGBf/NLBCkqQGALM6Wu6xt1XgDVTCjUCIkJaWFtaDmEeMGHEmxsU/C6xUxLeC5RZAQZblfsDTgOoBi7W1tb2mTZt2r6mXGeDDDz/0ZmRkWJqZjHAU8dt9qBxrARTaKrQCjQWIjIyMRp/PV1RQUBCSNGkPPvhgrc/nK4px8esQzb5tLaptLYBCW5/gCdrOptWiqKio/+LFi8e1tLSYNqHb7b74xhtvVNxzzz225jqMUI4Db2k1+451AjUq4wbmAqP0lOX1epPXrl2btmfPnkGB7nO73Rdvu+22k3PmzPmHXbn9o4QDwHuSJGnmIogoAwDIsuwC7gPuMVLu2rVrr6uuru579uzZnj///HOP5OTk31JSUprGjx//w9SpU1U7mjHONmCrJEkB07GE3QAGyAVmE+ajaWKAZsT0bkh3VIfDACCOp5+POLK8i+CcAtZgMX2fHsJlABBRRfcBE4HfSy5eo8jAXxFLumHZexlOAygMB2ahEV72O+YMsB44HM6XOmEAEK3BVOAuwHCqmRjjEmJl9UPC9Kn3xykDKPQH/h0Y6WQlHOQroBAxr+8IThtAIQPII8jkUQxxHChBbLxxlEgxgEI24qthqNMVCRHfAh8hduxExH98pBlAYRhwN5BJ9I8YZETCje2A4zkSOxKpBlC4BhgP3AyE7ByfEHEe2I1IuROxM5iRbgCFOGAEYlbxBiDB2epo0oSYt9+LyMaluqcykogWA/jTDUhHjBwy0YhECiN1iCb+K0QWDl0HVUQK0WiAjiQBnrafIQhDXBWidzUgBD8B+Np+6kP0rrAQCwZQIwEYgDDDAERfog/QG+iFmIjqBvRou/8C4pN7EWhEHKZ5HvHdfRoh+mkM5FKOFv4f4BVr5irhOlwAAAAASUVORK5CYII=');
    };
    /
    打开支持页面 /
    const goToSupport = () => {
    window.open('https://meta.appinn.com/t/7363', '_blank');
    };
    /
    复制净化后的链接和标题 /
    const getCleanUrlAndTitle = () => {
    const pureUrl = dms_get_pure_url();
    const ttileAndUrl = document.title + ' \n' + pureUrl;
    GM_setClipboard(ttileAndUrl);
    dmsCLNotification('链接地址已净化,并和网站标题一起复制到剪切板中~');
    if(window.location.href !== pureUrl) window.location.href = pureUrl;
    };
    /
    复制净化后的链接 /
    const getCleanUrl = () => {
    const pureUrl = dms_get_pure_url();
    GM_setClipboard(pureUrl);
    dmsCLNotification('链接地址已净化并复制到剪切板中~');
    if(window.location.href !== pureUrl) window.location.href = pureUrl;
    };
    /
    直接复制页面链接和标题 /
    const getUrlAndTitle = () => {
    const theUrl = document.title + ' \n' + window.location.href;
    GM_setClipboard(theUrl);
    dmsCLNotification('网站标题 & 链接地址已复制到剪切板中~');
    dmsLCToggleEl(panel);
    };
    /
    复制当前页面链接 /
    const getUrlOnly = () => {
    const theUrl = window.location.href;
    GM_setClipboard(theUrl);
    dmsCLNotification('链接地址已复制到剪切板中~');
    dmsLCToggleEl(panel);
    };
    /
    清理整个页面 */
    const cleanAllPage = () => {
    const aTagEles = document.getElementsByTagName('a');
    for (let i = 0; i < aTagEles.length; i++) {
    let theLink = aTagEles[i].href;
    if (theLink.match(/^(http://|https://|//)/) !== null) {
    theLink = theLink.replace(/^///, 'https://');
    aTagEles[i].href = dms_get_pure_url(theLink);
    }
    }
    panel.style.display = '';
    dmsCLNotification(
    '页面中所有链接已净化~\n可能导致部分链接无法使用,刷新后恢复。'
    );
    dmsLCToggleEl(panel);
    };

const pureUrl = dms_get_pure_url();
history.pushState({}, '', pureUrl);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant