您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
redirects Lemmy shortlinks to the appropriate page on KBin
当前为
// ==UserScript== // @name KBin Redirect // @namespace http://herzberd.dev/ // @version 0.1.2 // @description redirects Lemmy shortlinks to the appropriate page on KBin // @author @[email protected] https://github.com/herzberd https://herzberd.dev/ // @match https://kbin.social/* // @match https://fedia.io/* // @match https://karab.in/* // @match https://readit.buzz/* // @match https://forum.fail/* // @match https://fedi196.gay/* // @match https://kbin.chat/* // @icon https://www.google.com/s2/favicons?sz=64&domain=kbin.social // @grant none // @license CC0 1.0 Universal // ==/UserScript== 'use strict'; const pattern = /!([A-Za-z0-9_]+)@([A-Za-z0-9.-]+)\b/g var elements = document.getElementsByTagName('a') for (var i = 0; i < elements.length; i++) { const matches = [...elements[i].innerText.matchAll(pattern)] if (matches.length > 0) { matches.forEach((match) => { const topic = match[1] const domain = match[2] elements[i].href = '/m/' + topic + '@' + domain }) } }