Skip to content

v3.2.0 — Downloads, context menu, badge, dark mode, more parsers + repo hygiene#63

Merged
doctorlai-msrc merged 1 commit into
masterfrom
3.2.0
Jun 28, 2026
Merged

v3.2.0 — Downloads, context menu, badge, dark mode, more parsers + repo hygiene#63
doctorlai-msrc merged 1 commit into
masterfrom
3.2.0

Conversation

@doctorlai-msrc

Copy link
Copy Markdown
Collaborator

v3.2.0 — Downloads, context menu, badge, dark mode, more parsers + repo hygiene

Summary

Turns the extension from a "find video URLs" helper into an actual download helper, adds several
low‑effort/high‑value UX features, broadens site coverage, and cleans up a few repo/tooling issues.
Bumps the version 3.1.0 → 3.2.0.

Heads‑up for reviewers: the diff shows ~7.5k±/6.7k− lines, but the vast majority is a one‑time
CRLF → LF normalization. Review with “Hide whitespace” (?w=1) to see the real change set.
Happy to split the normalization into its own PR if preferred (see Repo / tooling below).

Motivation

Despite being a “Download Helper”, the extension previously only rendered detected media as links —
users still had to right‑click → Save As. This PR adds real one‑click downloads and the surrounding
UX users expect, plus a few new parsers and housekeeping.

✨ Features

Real one‑click downloads + clipboard

  • Download button on each detected video/audio/image, using chrome.downloads (with a
    new‑tab fallback when a programmatic download is blocked).
  • Copy, Download All, and Copy All actions.
  • Buttons are wired via CSP‑safe jQuery event delegation (no inline handlers).
  • Suggested filenames derived from the page title via new, unit‑tested helpers in
    js/functions.js: getFileExtension, sanitizeFilename, suggestFilename.

Right‑click context menu

  • “Download this video / audio” (on <video>/<audio> elements).
  • “Find videos on this page”.

Toolbar badge

  • The action icon shows a count of media URLs detected on the current tab; cleared on navigation.

Dark mode

  • A persisted Dark Mode toggle in Settings.

More site coverage (js/parsevideo.js)

  • New site parsers: Dailymotion and Vimeo.
  • New generic fallbacks: HTML <source> tags and embedded HLS .m3u8 playlists
    (added to the existing og:video / <video src> / video_url / mp4 strategies).

Internationalization

  • New UI strings (download, copy, download_all, copy_all, copied, copy_failed,
    dark_mode, dark_desc) added to all 13 locales and wired into js/translate.js.

🔐 Permissions (Chrome Web Store)

  • Added "downloads" and "contextMenus". No new host permissions; the broad content‑script
    scope is pre‑existing and unchanged.
  • downloads adds the “Manage your downloads” warning, so the extension will require user
    re‑consent on auto‑update — expected for the new capability.
  • All downloads are user‑initiated (button / context‑menu click), filenames are sanitized,
    there are no automatic/background downloads and no remote code — consistent with the
    single‑purpose policy.

🧹 Repo / tooling

  • dist/dist.min.js removed from version control. It was a stale tracked build artifact;
    .gitignore already listed dist/. CI and npm run package rebuild it, and the README
    “Load unpacked” steps now include npm install && npm run build.
  • Consistent line endings. Added .gitattributes (* text=auto eol=lf) and normalized all
    our source to LF. Vendored third‑party libs (jQuery, Bootstrap, MD5.js, m_inc.js,
    *.min.*) are preserved byte‑for‑byte; test/data/** is LF but exempt from whitespace
    linting (captured HTML). Also stripped pre‑existing trailing whitespace per .editorconfig.
  • background.js hardening. Guarded the service‑worker IIFE so it no longer throws when the
    file is injected as a content script or when there is no active tab. Service‑worker‑only logic
    (badge + context menus) is gated to the SW context.
  • Version bump to 3.2.0 across manifest.json, both package.json, and both lockfiles.

✅ Testing & validation

  • npm run check is green: ESLint + Prettier + 129 Mocha tests passing.
  • Coverage stays above gates (90/70): ~99.7% lines / ~81% branches.
  • 5 new test specs + 2 fixtures:
    • test_parsevideo_dailymotion.js, test_parsevideo_vimeo.js,
      test_parsevideo_source_tag.js, test_parsevideo_m3u8.js, test_functions_filename.js
    • test/data/dailymotion-x2bu0q2.html, test/data/vimeo-151712690.html
  • node --check passes on all changed legacy JS and all 13 locales; all 15
    _locales/*/messages.json parse.
  • npm run package produces the Web Store zip (simple-video-download-helper-3.2.0.zip).
  • git diff --check is clean.

Files of interest

  • Parsers/helpers (unit‑tested): js/parsevideo.js, js/functions.js
  • Popup UX: js/video.js, main.html, css/main.css
  • Service worker: js/background.js, manifest.json
  • i18n: js/translate.js, lang/*.js, _locales/*/messages.json

Reviewer checklist

  • Review with whitespace hidden (the bulk of the diff is EOL normalization).
  • Confirm the two new permissions (downloads, contextMenus) are acceptable for the listing,
    and note the one‑time re‑consent on update.
  • Decide whether to keep the line‑ending normalization in this PR or split it out.
  • Sanity‑check the unpacked build: cd video-url-parser && npm install && npm run build,
    then load video-url-parser/ via chrome://extensions.

Notes

  • The published Web Store build still excludes YouTube and adult sites (unchanged).
  • The new parsers follow the existing pattern‑based approach; generic <source> / .m3u8
    fallbacks improve coverage on many sites beyond the two named additions.

@doctorlai-msrc doctorlai-msrc merged commit 496c119 into master Jun 28, 2026
4 checks passed
@doctorlai-msrc doctorlai-msrc deleted the 3.2.0 branch June 28, 2026 21:25
@doctorlai-msrc doctorlai-msrc restored the 3.2.0 branch June 28, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant