While web is very image-heavy medium, browsers aren’t great image viewers. When viewing large images site might try to help with some kind of media viewer (at best), but more often you are starting at part of image that fits in window and scroll back and forth.
What is needed
Assuming we are looking at image opened by direct URL we only need two things:
- retrieve browser window dimensions;
- resize image accordingly.
Strangely there are many code examples around that show this separately, but no good and simple bookmarklets that combine them at all.
After amount of time I wasted on this, result is laughably tiny:
This code grabs first (zero-ish in computer array speak) image on page and we have only that one when looking at direct URL. Then it assigns to image value of height, taken from browser window object.
Save this as bookmark or drag on browser toolbar (with Shift pressed in case of Opera).
Feels anticlimactic when something that annoys you for a long time turns out that easy to solve. But if there is one piece of productivity wisdom computers slowly pounded into me – it is getting rid of small annoyances that makes time to tackle more complex and interesting things.
Ian Andrews #