Skip to content

Instantly share code, notes, and snippets.

@rniswonger
Last active August 24, 2023 16:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rniswonger/7baf53274a173051cc76bb0a07903f3a to your computer and use it in GitHub Desktop.
Save rniswonger/7baf53274a173051cc76bb0a07903f3a to your computer and use it in GitHub Desktop.
A bookmarklet that resizes image and table content in Gmail messages to prevent horizontal scrolling.

To use

  1. copy the code,
  2. create a bookmark to Gmail (suggest you add to your Bookmark Bar),
  3. edit the bookmark and replace the URL with the copied code.

Running this bookmarklet when viewing Gmail desktop will:

  • resize images and tables that cause the window to side-scroll
  • hide ads
javascript: (() => { let style = document.createElement("style"); style.innerHTML = ` .a3s table { width: 90% !important; } .a3s img { max-width: 90% !important; height: auto !important; } tr:has(.ast) { display: none !important; } `; document.head.appendChild(style);})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment