Skip to content

Commit 1341d31

Browse files
For local development for Firefox.
1 parent bf3a2ce commit 1341d31

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

manifest-firefox-override.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/sh
2+
3+
# Local development workaround for Firefox.
4+
#
5+
# Once you build this extension (with `npm install` and `npm run build`, as per <README.md>), to
6+
# load it, visit Firefox special URL about:debugging#/runtime/this-firefox. Click button "Load
7+
# Temporary Add-on..." That button shows a file/folder picker.
8+
#
9+
# Problem: The file picker does allow you to select `manifest.firefox.json`, BUT it will not load
10+
# it. It loads `manifest.json` (from the directory where you selected `manifest.firefox.json`)
11+
# instead. (Indeed, a Firefox defect - but life is too short for us to waste it on Mozilla's
12+
# bugzilla....)
13+
#
14+
# Firefox doesn't allow to use symlinks to workaround the above problem (see
15+
# https://bugzilla.mozilla.org/show_bug.cgi?id=803999 - symlinks are a security problem).
16+
#
17+
# Workaround: This script
18+
# 1. copies manifest.firefox.json over manifest.json
19+
# 2. prevents that change from being accidentally committed to GIT.
20+
21+
# Enter the directory where this script is (in case we call it from somewhere else).
22+
cd "${0%/*}"
23+
24+
# Invoking `/usr/bin/cp` directly, in case there's an alias that warns about overriding existing
25+
# files.
26+
/usr/bin/cp manifest.firefox.json manifest.json
27+
28+
# See also
29+
# https://stackoverflow.com/questions/13630849/git-difference-between-assume-unchanged-and-skip-worktree
30+
git update-index --skip-worktree manifest.json

0 commit comments

Comments
 (0)