您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Copy tweet links with one click and strip query parameters
- // ==UserScript==
- // @name Twitter fast clean link copy
- // @namespace http://tampermonkey.net/
- // @version 0.2
- // @description Copy tweet links with one click and strip query parameters
- // @author cro
- // @match https://*.twitter.com/*
- // @match https://*.x.com/*
- // @icon https://www.google.com/s2/favicons?domain=twitter.com
- // @grant none
- // @license MIT
- // ==/UserScript==
- /* jshint esversion: 6 */
- (function()
- {
- 'use strict';
- let id = 'cro-copy-id';
- let make_button = function()
- {
- let button = document.createElement('button');
- button.textContent = 'copy link';
- button.onclick = function ()
- {
- let url = new URL(button.closest('article').querySelector('[href*="status"]').href);
- url.pathname = url.pathname.split('/').slice(0,4).join('/');
- navigator.clipboard.writeText(url.toString());
- };
- button.id = id;
- return button;
- };
- setInterval(function()
- {
- let nodes = document.querySelectorAll('article div[role="group"]');
- for (let node of nodes)
- {
- if (!node.querySelector(`#${id}`))
- {
- node.lastChild.append(make_button());
- }
- }
- }, 250);
- })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址