Last active
May 18, 2024 20:43
-
-
Save twinkfrag/d11c9672c39d3a7ffd02 to your computer and use it in GitHub Desktop.
twitterの画像付きステータスページにオリジナルサイズの画像へのリンクを配置するUserScript
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 add twitter original image link | |
// @namespace twinkfrag.net | |
// @include /https?://twitter\.com/\w+/status/\d+/ | |
// @include /https?://twitter\.com/\w+/status/\d+/photo/1/ | |
// @desctiption twitterの画像付きステータスページにオリジナルサイズの画像へのリンクを配置します | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js | |
// @version 1.2 | |
// @grant none | |
// ==/UserScript== | |
$(function() { | |
for(var i = 0; i < $(".media-thumbnail").length; i++) { | |
$("[aria-label='Tweet actions']") | |
.append($("<div/>") | |
.addClass("ProfileTweet-action ProfileTweet-action--oiginal-image") | |
.append($("<a/>") | |
.addClass("ProfileTweet-actionButton u-textUserColorHover js-tooltip image-original-link") | |
.attr("href", $(".permalink-tweet [data-url] :eq(" + i + ")").attr("data-url").replace(/https?:/,"").match(/[^:]+/)[0]+":orig") | |
.attr("title", "Original Imege") | |
.append($("<span/>").addClass("Icon Icon--photo")))); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment