您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Turns the text in various subreddits' flair into links
当前为
// ==UserScript== // @name Reddit Flair Linkifier // @namespace https://greasyfork.org/users/649 // @version 2.1 // @description Turns the text in various subreddits' flair into links // @author Adrien Pyke // @match *://*.reddit.com/* // @require https://gitcdn.link/repo/fuzetsu/userscripts/b38eabf72c20fa3cf7da84ecd2cefe0d4a2116be/wait-for-elements/wait-for-elements.js // @grant GM_addStyle // ==/UserScript== (() => { 'use strict'; GM_addStyle(` .flair-link { text-decoration: none; } .flair-link:hover { text-decoration: underline; } `); const newLayoutId = '#SHORTCUT_FOCUSABLE_DIV'; waitForElems({ sel: [ // old reddit 'span.flair', 'span.Comment__authorFlair', // new reddit `${newLayoutId} span` ].join(','), onmatch(flair) { flair.innerHTML = flair.textContent.split(' ').map(segment => { if (segment.match(/^https?:\/\//)) { return `<a href="${segment}" class="flair-link" target="_blank" rel="noopener noreferrer">${segment}</a>`; } else { return segment; } }).join(' '); } }); })();