Extract common extension utilities (runtime messages, DNR updates, transport validation) into reusable functions in webext.ts and transport.ts. Consolidate Vite configuration creation with new createBaseViteConfig() function to reduce duplication across build configs. Move headers.json from vite/lib/extension/ to src/ and improve build pipeline organization for Firefox and Chrome extension builds.
Large refactor: improve subtitle parsing, tokenization and wrapping (displayModel, renderPlan, smartWrap, standards, widget) to handle HTML tags, punctuation, attached word/number cases and VTT/ASS edge cases. Simplify VideoManager/VideoHandler mute API (removed preserve option) and add logic to preserve YouTube volume storage where needed; update smart ducking usage and UI volume handling. Sanitize extension bridge/notifications errors and GM notification fields. Restructure Vite build helpers into vite/lib (paths, env, manifest/userscript tooling, chrome-postbuild) and update configs to use new utilities. Misc utils and filename trimming fixes.
- Simplify expressions and replace manual attribute manipulation with toggleAttribute
- Extract MountCache type and add LangOverride type for better type safety
- Parallelize file I/O operations in build scripts for improved performance
- Add caching for alt-URL match patterns to avoid redundant computations
- Fix type inconsistencies (xhrSessionId should be string)
- Cache country code lookups to eliminate duplicate function calls
- Convert locale header reading to async and reuse across build phases
- Add chunkSizeWarningLimit and CSS code split disable to build configs
- Change useLivelyVoice default from true to false
- Refactor function parameters to use options objects for better clarity