Last active
August 4, 2016 13:44
-
-
Save cocoabox/034c58493764cc763af691d9af7561cd to your computer and use it in GitHub Desktop.
ツイッターの画像を原寸大に表示する(使い方:以下のテキストをコピーして、ブラウザのツールバーに「新しいページ」→アドレス欄に貼り付ける)
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
javascript: var re = /^(.*?)(:[a-z]+)?$/; | |
[].forEach.call(document.getElementsByClassName("media-img"), function(e) { | |
var orig = (e.src ? e.src : "").replace(re, "$1:orig"); | |
window.open(orig); | |
}); | |
var dlg = document.getElementsByClassName("permalink-container"); | |
if (dlg.length) { | |
[].forEach.call(dlg[0].getElementsByClassName("AdaptiveMedia-photoContainer"), function(div) { | |
[].forEach.call(div.getElementsByTagName("img"), function(img) { | |
var orig = (img.src ? img.src : "").replace(re, "$1:orig"); | |
window.open(orig); | |
}); | |
}); | |
} | |
[].forEach.call(document.getElementsByClassName("Gallery-media"), function(div) { | |
[].forEach.call(div.getElementsByTagName("img"), function(img) { | |
var orig = (img.src ? img.src : "").replace(re, "$1:orig"); | |
window.open(orig); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment