您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
在 V2EX 帖子页面添加一个分享按钮,点击后跳转到 v2ex-share 页面
// ==UserScript== // @name Share Card // @namespace https://glidea.zenfeed.xyz/ // @version 1.0.1 // @description 在 V2EX 帖子页面添加一个分享按钮,点击后跳转到 v2ex-share 页面 // @author Glidea // @match https://*v2ex.com/t/* // @license MIT // @grant none // ==/UserScript== ; (function () { 'use strict' window.addEventListener('load', function () { const topicBox = document.querySelector('#Main > .box[style="border-bottom: 0px;"]') if (topicBox) { const pathParts = window.location.pathname.split('/') const topicId = pathParts[2] if (topicId) { const shareCell = document.createElement('div') shareCell.className = 'cell' shareCell.style.textAlign = 'center' const shareButton = document.createElement('a') shareButton.textContent = '卡片分享' shareButton.style.backgroundColor = '#778087' shareButton.style.color = 'white' shareButton.style.padding = '10px 20px' shareButton.style.textDecoration = 'none' shareButton.style.display = 'inline-block' shareButton.style.borderRadius = '3px' shareButton.style.fontSize = '14px' shareButton.style.fontWeight = 'bold' const shareUrl = `https://v2ex-share.zenfeed.xyz/t/${topicId}` shareButton.href = shareUrl shareButton.target = '_blank' shareCell.appendChild(shareButton) topicBox.appendChild(shareCell) } } }) })()