Skip to content

Instantly share code, notes, and snippets.

@MattBlissett
Last active October 21, 2015 02:50
Show Gist options
  • Save MattBlissett/8412ba5a66cb83fd093d to your computer and use it in GitHub Desktop.
Save MattBlissett/8412ba5a66cb83fd093d to your computer and use it in GitHub Desktop.
Browser bookmarklet: reduce width of a page
javascript:(function(){var body = document.getElementsByTagName('body')[0];var style = body.style;var ss = [55,34,21,13,8];var sx = ('bodyMaxWidthIndex' in body) ? body.bodyMaxWidthIndex : 1;style.setProperty('max-width', ss[++sx % ss.length]+'cm', 'important');style.setProperty('line-height', '1.5');style.setProperty('margin-left', 'auto');style.setProperty('margin-right', 'auto');style.setProperty('font-family', 'sans-serif');body.bodyMaxWidthIndex = sx;})();
@MattBlissett
Copy link
Author

Toggles between various maximum widths for the current web page, increases default line spacing slightly and makes the default font sans-serif.

Intended for browsing unstyled (or little-styled) web pages on wide-screen monitors.

Select the whole link and drag to your bookmark bar.

This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment