mirror of
https://github.com/lawrencehook/remove-youtube-suggestions.git
synced 2026-07-24 22:44:30 +00:00
8bd023881d
* Port dev.sh + release CI from curb; make redirects free dev.sh runs Firefox via web-ext from src/ and Chrome from a dist/chrome/ symlink tree. The two manifests live at different paths, so both browsers can run side-by-side without clobbering each other's manifest.json. Edits in src/ propagate live to both. release.yml builds Chrome + Firefox zips on tag push (v*) and attaches them to a GitHub Release, retiring the manual extension.zip workflow. The four redirect-home options (redirect_to_subs / _to_wl / _to_library / _off) drop the premium flag — they're advertised on the store listings, so it feels right to have them free. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Trim dev section in README to just the commands Cut the rationale paragraphs (symlink trick, manifest clobbering); anyone needing that detail can read dev.sh. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Sync dist/chrome with rsync instead of symlinks Chrome's content-script loader silently rejects scripts whose realpath is outside the extension directory. The popup loaded fine through symlinks but content scripts on YouTube never injected (no Chrome error, just nothing). Real file copies sidestep the realpath check. Trade-off: re-run dev.sh chrome and click reload after edits. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Fix redirect-to-Library URL after YouTube renamed Library to You YouTube renamed the Library section to "You" and moved its URL from /feed/library to /feed/you. The redirect option silently broke. Fixes #123 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
52 lines
1.5 KiB
Bash
Executable File
52 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Local dev launcher. Two strategies, one per browser:
|
|
#
|
|
# firefox Run web-ext from src/ directly. Drops firefox_manifest.json
|
|
# in as manifest.json and launches a temp Firefox profile.
|
|
#
|
|
# chrome Sync src/ into dist/chrome/ as real files (rsync), with
|
|
# chrome_manifest.json copied in as manifest.json. Load as
|
|
# an unpacked extension via chrome://extensions.
|
|
#
|
|
# We don't symlink — Chrome's content-script loader silently
|
|
# rejects scripts whose realpath is outside the extension
|
|
# directory, so the popup loads but content scripts don't fire.
|
|
# Re-run this script and click "reload" in chrome://extensions
|
|
# after editing src/.
|
|
|
|
set -euo pipefail
|
|
|
|
browser="${1:-}"
|
|
case "$browser" in
|
|
firefox|chrome) ;;
|
|
*) echo "Usage: $0 <firefox|chrome>" >&2; exit 1 ;;
|
|
esac
|
|
|
|
repo="$(cd "$(dirname "$0")" && pwd)"
|
|
src="$repo/src"
|
|
|
|
case "$browser" in
|
|
firefox)
|
|
cd "$src"
|
|
cp firefox_manifest.json manifest.json
|
|
trap 'rm -f "$src/manifest.json"' EXIT
|
|
echo "Launching: web-ext run from $src"
|
|
exec web-ext run
|
|
;;
|
|
|
|
chrome)
|
|
dst="$repo/dist/chrome"
|
|
mkdir -p "$dst"
|
|
|
|
rsync -a --delete \
|
|
--exclude='*_manifest.json' \
|
|
--exclude='manifest.json' \
|
|
--exclude='web-ext-artifacts' \
|
|
"$src/" "$dst/"
|
|
|
|
cp "$src/chrome_manifest.json" "$dst/manifest.json"
|
|
echo "Ready: $dst"
|
|
echo "In chrome://extensions, enable Developer mode and 'Load unpacked' → $dst"
|
|
;;
|
|
esac
|