Skip to content

v2.1.0 — working cross-origin downloads

Choose a tag to compare

@theinstantwin theinstantwin released this 26 Jul 22:47
· 8 commits to main since this release

Drag any image to download it. No right-click, no menu, no save dialog.

Install

Install it from the Chrome Web Store.

To load it by hand instead:

  1. Download nab-2.1.0.zip below and unzip it. Keep the folder somewhere permanent — Chrome loads the extension from it, so deleting it uninstalls Nab.
  2. Go to chrome://extensions
  3. Turn on the Developer mode toggle
  4. Click Load unpacked and pick the unzipped folder
  5. Reload any tabs you already had open

What changed

Downloads now run through chrome.downloads in a service worker, which handles the CDN-hosted images the previous approach could not save. Notifications report the result the download API actually returns instead of assuming success.

Native drag is suppressed through dragstart rather than mousedown, so clicks on linked images and site lightboxes keep working.

Filenames strip query strings before the extension check, so photo.jpg?w=800 saves as photo.jpg. SVG and JPEG extensions come out right.

content.js went from 645 to 280 lines: an unused isCrossOrigin, an unreachable CORS fallback, a stubbed background-image branch, a logging layer that needed a source edit to switch on, scroll and resize handlers tracking the outline through a sub-second drag, and null checks for conditions that cannot occur.

Known issue

The toolbar icon has an opaque white background, so it renders as a white square on a dark toolbar. Fix needs an icon redesign rather than a background delete.