Created
October 28, 2010 14:03
-
-
Save rochefort/651402 to your computer and use it in GitHub Desktop.
(gm)display real image size
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 display real image size | |
// @namespace http://www.rochefort8.com/ | |
// @include * | |
// ==/UserScript== | |
(function(){ | |
var imgs, img; | |
imgs = xpath('//img'); | |
if(!imgs.snapshotLength) return; | |
for(var i = 0; i < imgs.snapshotLength; i++){ | |
img = imgs.snapshotItem(i); | |
img.addEventListener('mouseover', function(event) { | |
alert(this.naturalWidth + " x " + this.naturalHeight); | |
}, false); | |
} | |
function xpath(query) { | |
return document.evaluate(query, document, null, | |
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
画像の実サイズを表示するgreasemonkey - うんたらかんたら日記
http://d.hatena.ne.jp/rochefort/20101028/p1