Created
January 10, 2024 06:28
-
-
Save mohemohe/56d62c50682077e8c7e11f681f1d06a6 to your computer and use it in GitHub Desktop.
FxTwitterの共有リンクをクリップボードにコピー
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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/[email protected] | |
// ==/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