Skip to content

Instantly share code, notes, and snippets.

@cocoabox
Last active August 4, 2016 13:44
Show Gist options
  • Save cocoabox/034c58493764cc763af691d9af7561cd to your computer and use it in GitHub Desktop.
Save cocoabox/034c58493764cc763af691d9af7561cd to your computer and use it in GitHub Desktop.
ツイッターの画像を原寸大に表示する(使い方:以下のテキストをコピーして、ブラウザのツールバーに「新しいページ」→アドレス欄に貼り付ける)
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