您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
直接提取放牧的风在页面上提供的链接。
当前为
// ==UserScript== // @name 放牧的风 - 免费 SS/SSR/V2Ray 页面增加“所有链接” // @description 直接提取放牧的风在页面上提供的链接。 // @namespace UnKnown // @match https://www.youneed.win/free-ss // @match https://www.youneed.win/free-ssr // @match https://www.youneed.win/free-v2ray // @version 1.2 // @grant none // ==/UserScript== (() => { const parentNode = document.querySelector('.context'); const referenceNode = parentNode.querySelector(':scope > div'); const table = referenceNode.querySelector(':scope > table:only-child'); if (!table) return false; const arraySelector = ( selector = ':scope > *', parent = table, ) => Array.from( parent.querySelectorAll( selector ) ); const getLinks = type => ({ ss: () => arraySelector(':scope > tbody > tr').map( tr => { const d = data = arraySelector(':scope > td', tr).map( td => td.textContent ); return 'ss://' + base64(`${d[4]}:${d[3]}@${d[1]}:${d[2]}`); } ).join("\n"), ssr: () => Array.from( table.querySelectorAll( 'a[href^="' + protocolMap.get( location.pathname.slice(6) ) + '"]' ) ).map( a => a.href ).join("\n"), v2ray: () => arraySelector(':scope > tbody > tr').map( tr => { const d = data = arraySelector(':scope > td', tr).map( td => td.textContent ); return 'vmess://' + base64(`{"ps":"[youneed.win]${data[1]}","add":"${data[1]}","port":"${data[2]}","id":"${data[3]}","aid":"0","net":"${data[4]}","type":"none","host":"${data[5]}","tls":"${data[6]}"}`); } ).join("\n"), })[type]; const type = location.pathname.slice(6); let base64; if (type === ("ss" || "v2ray") && !window.CryptoJS) { // From https://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/Base64#Javascript base64 = s => { var d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = "", p = "", c = s.length % 3; if (c > 0) { for (; c < 3; c++) { p += '=', s += "\0"; } } for (c = 0; c < s.length; c += 3) { var n = (s.charCodeAt(c) << 16) + (s.charCodeAt(c + 1) << 8) + s.charCodeAt(c + 2); n = [(n >>> 18) & 63, (n >>> 12) & 63, (n >>> 6) & 63, n & 63]; r += d[n[0]] + d[n[1]] + d[n[2]] + d[n[3]]; } return r.substring(0, r.length - p.length) + p; } } else { base64 = str => CryptoJS.enc.Base64.stringify( CryptoJS.enc.Utf8.parse(str) ); } const resultStr = getLinks(type)(); // 元素 // 所有链接 const pre = document.createElement("pre"); pre.style = "max-height: 12em; overflow-y: auto; margin-bottom: 10px;"; pre.textContent = resultStr; // 复制按钮 const button = document.createElement("button"); button.style = "width: 100%; font-size: large;"; button.textContent = "复制全部链接"; button.addEventListener("click", () => { try { if (navigator.clipboard) { navigator.clipboard.writeText(resultStr); } else { const eventCopyer = event => { event.preventDefault(); event.clipboardData.setData("text/plain", resultStr); } document.addEventListener("copy", eventCopyer); document.execCommand("copy"); document.removeEventListener("copy", eventCopyer); } } catch (error) { button.parentNode.insertBefore((str => { const info = document.createElement("pre"); info.textContent ="若复制失败,请手动选择复制," + "PC 端用户可按 F12 获取详细错误信息,以便反馈。" + "\n捕捉到的错误信息:" + str; })(error), button.nextSibling); } }); const newNode = document.createElement("div"); newNode.id = "AllLinks"; newNode.appendChild(pre); newNode.appendChild(button); parentNode.insertBefore(newNode, referenceNode); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址