您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Redirects Reddit links to Acorn app
// ==UserScript== // @name Reddit to Acorn Redirector // @namespace http://greasyfork.org/ // @version 1.0 // @description Redirects Reddit links to Acorn app // @author Unholy // @match *://*.reddit.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; const match = window.location.href.match( /^(?:https?:\/\/)?(?:(?:www|amp|m|i)\.)?(?:(?:reddit\.com))\/r\/(\w+)(?:\/comments\/(\w+)(?:\/\w+\/(\w+)(?:\/?.*?[?&]context=(\d+))?)?)?/i ); if (match) { window.stop(); const community = match[1]; const postId = match[2]; const commentId = match[3]; const context = match[4]; if (postId && commentId && context) { window.location.replace( `acorn:///posts/${postId}?commentId=${commentId}&context=${context}` ); return; } if (postId && commentId) { window.location.replace( `acorn:///posts/${postId}?commentId=${commentId}` ); return; } if (postId) { window.location.replace(`acorn://posts//${postId}`); return; } window.location.replace(`acorn:///communities/${community}`); } })();