SVG Gobbler is a browser extension by Ross Moody that scans the page you are viewing for vector content and offers to download, optimize, copy, view the code of, or export that content as an image.

Grabbing an SVG is straightforward when a site serves it through an <img> element, since right-click and save-as work as they do for any other image. Inline <svg> markup is a different matter. Inline SVG is often the sensible choice for styling reasons, but extracting a copy by hand means opening DevTools, locating the <svg>, choosing Copy > Copy outerHTML, pasting into a text file, and saving it as whatever.svg.

Show an open DevTools window with a contextual MacOS menu open on top of it with the option Copy highlighted, which opens to a second panel in the contextual menu where an option to copy the HTML is highlighted in bright blue.

Clicking the extension presents the found SVGs in a grid of options.

A browser window open with a black header that has the red SVG Gobbler logo flashed left and white buttons to send feedback and toggle dark mode flashed right. Below that is a grid of SVG icons, including the CSS-Tricks logo, a magnifying glass, a close icon, a downward chevron, the Jetpack logo, and an orange downward arrow.

Downloading from that grid is quick, and the extension can also optimize the file or export it as a PNG instead.

Suggested improvements

The extension prompted a handful of feature requests:

  1. A way to set the size of the PNG export, so a very large image can be produced when needed.
  2. Export to newer formats such as WebP or AVIF, which may beat PNG on file size.
  3. SVGs filled with white should be previewed against a non-white background so their contents are visible.
  4. Optionally allow the file to be named at download time, rather than always using gobbler-original.svg.

Styles lost on export

A stretch goal would be to fold the CSS applied on the page into the extracted <svg>. Some SVGs look markedly different once exported, because the page was styling them with rules outside the SVG itself, and those rules do not survive the export.

One open question is whether recent changes to Safari extensions will make a Safari port easy, including a possible Mobile Safari version.