Skip to content

Instantly share code, notes, and snippets.

@mohemohe
Created January 10, 2024 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohemohe/56d62c50682077e8c7e11f681f1d06a6 to your computer and use it in GitHub Desktop.
Save mohemohe/56d62c50682077e8c7e11f681f1d06a6 to your computer and use it in GitHub Desktop.
FxTwitterの共有リンクをクリップボードにコピー
// ==UserScript==
// @name FxTwitter
// @namespace Violentmonkey Scripts
// @match https://twitter.com/*/status/*
// @grant none
// @version 1.0
// @author -
// @description 2024/1/10 14:48:46
// @require https://cdn.jsdelivr.net/npm/@violentmonkey/shortcut@1
// @require https://cdn.jsdelivr.net/combine/npm/@violentmonkey/dom@2,npm/@violentmonkey/ui@0.7
// ==/UserScript==
const { register } = VM.shortcut;
register('ctrlcmd-s', () => {
const link = location.href.replace("twitter.com/", "fxtwitter.com/");
navigator.clipboard.writeText(link)
.then(() => VM.showToast('共有リンクをコピーしました'))
.catch(() => VM.showToast('共有リンクのコピーに失敗しました'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment