diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index c3ae74a1f..993900d21 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -10792,6 +10792,10 @@ $.asap((function() { return post.file.fullImage[naturalHeight]; }), function() { + if (isVideo) { + img.style.maxHeight = img[naturalHeight] + "px"; + img.style.maxWidth = img['videoWidth'] + "px"; + } return ImageExpand.completeExpand(post); }); return $.after((img.controls ? thumb.parentNode : thumb), img); diff --git a/builds/crx/script.js b/builds/crx/script.js index 5f87c01b4..2ca5970a5 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -10830,6 +10830,10 @@ $.asap((function() { return post.file.fullImage[naturalHeight]; }), function() { + if (isVideo) { + img.style.maxHeight = img[naturalHeight] + "px"; + img.style.maxWidth = img['videoWidth'] + "px"; + } return ImageExpand.completeExpand(post); }); return $.after((img.controls ? thumb.parentNode : thumb), img); diff --git a/src/Images/ImageExpand.coffee b/src/Images/ImageExpand.coffee index bcf21a8d8..f1eee2eb0 100644 --- a/src/Images/ImageExpand.coffee +++ b/src/Images/ImageExpand.coffee @@ -118,6 +118,10 @@ ImageExpand = img.controls = Conf['Show Controls'] $.on img, 'error', ImageExpand.error $.asap (-> post.file.fullImage[naturalHeight]), -> + if isVideo + # XXX Firefox doesn't seem to size videos correctly? + img.style.maxHeight = img[naturalHeight] + "px" + img.style.maxWidth = img['videoWidth'] + "px" ImageExpand.completeExpand post $.after (if img.controls then thumb.parentNode else thumb), img