Skip to content

Commit

Permalink
Reorganize platform directory to avoid Chromium-centric appearance
Browse files Browse the repository at this point in the history
Though Firefox shares a lot of WebExtensions code with Chromium,
these platforms have their own specific code paths, for various
reasons.

The reorganization here makes it clear that Chromium platform is
just one flavor of WebExtensions, and as such all Chromium-specific
code paths should no longer be automatically pulled by other
platforms where these code paths are not needed.

Given that the filepath of many files changed, here is the
parent commit to quickly browse back to the previous directory
layout:

ec7db30
  • Loading branch information
gorhill committed Jul 16, 2021
1 parent ec7db30 commit a4aced6
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 132 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions platform/webext/README.md

This file was deleted.

113 changes: 0 additions & 113 deletions platform/webext/manifest.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/background.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<script src="js/vapi.js"></script>
<script src="js/vapi-common.js"></script>
<script src="js/vapi-background.js"></script>
<script src="js/vapi-webrequest.js"></script><!-- Forks can pick the webext, chromium, or their own implementation -->
<script src="js/vapi-background-ext.js"></script><!-- platform-specific to extend common code paths -->
<script src="js/background.js"></script>
<script src="js/traffic.js"></script>
<script src="js/hntrie.js"></script>
Expand Down
5 changes: 2 additions & 3 deletions tools/copy-common-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ cp -R src/web_accessible_resources $DES/
cp -R src/_locales $DES/

cp src/*.html $DES/
cp platform/chromium/*.js $DES/js/
cp platform/chromium/*.html $DES/
cp platform/chromium/*.json $DES/
cp platform/common/*.js $DES/js/
cp platform/common/*.json $DES/
cp LICENSE.txt $DES/
8 changes: 7 additions & 1 deletion tools/make-chromium.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ DES=dist/build/uBlock0.chromium
rm -rf $DES
mkdir -p $DES

echo "*** uBlock0.chromium: copying common files"
echo "*** uBlock0.chromium: Copying common files"
bash ./tools/copy-common-files.sh $DES

# Chromium-specific
echo "*** uBlock0.chromium: Copying chromium-specific files"
cp platform/chromium/*.js $DES/js/
cp platform/chromium/*.html $DES/
cp platform/chromium/*.json $DES/

# Chrome store-specific
cp -R $DES/_locales/nb $DES/_locales/no

Expand Down
12 changes: 7 additions & 5 deletions tools/make-firefox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ DES="$BLDIR"/uBlock0.firefox
rm -rf $DES
mkdir -p $DES

echo "*** uBlock0.firefox: copying common files"
echo "*** uBlock0.firefox: Copying common files"
bash ./tools/copy-common-files.sh $DES

cp -R $DES/_locales/nb $DES/_locales/no
# Firefox-specific
echo "*** uBlock0.firefox: Copying firefox-specific files"
cp platform/firefox/*.json $DES/
cp platform/firefox/*.js $DES/js/

cp platform/firefox/manifest.json $DES/
cp platform/firefox/webext.js $DES/js/
cp platform/firefox/vapi-webrequest.js $DES/js/
# Firefox store-specific
cp -R $DES/_locales/nb $DES/_locales/no

# Firefox/webext-specific
rm $DES/img/icon_128.png
Expand Down
11 changes: 9 additions & 2 deletions tools/make-opera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@ DES=dist/build/uBlock0.opera
rm -rf $DES
mkdir -p $DES

echo "*** uBlock0.opera: copying common files"
echo "*** uBlock0.opera: Copying common files"
bash ./tools/copy-common-files.sh $DES

# Chromium-specific
echo "*** uBlock0.opera: Copying chromium-specific files"
cp platform/chromium/*.js $DES/js/
cp platform/chromium/*.html $DES/

# Opera-specific
cp platform/opera/manifest.json $DES/
echo "*** uBlock0.opera: Copying opera-specific files"
cp platform/opera/manifest.json $DES/

rm -r $DES/_locales/az
rm -r $DES/_locales/cv
rm -r $DES/_locales/hi
Expand Down
11 changes: 7 additions & 4 deletions tools/make-thunderbird.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ mkdir -p $DES
echo "*** uBlock0.thunderbird: copying common files"
bash ./tools/copy-common-files.sh $DES

cp -R $DES/_locales/nb $DES/_locales/no
echo "*** uBlock0.firefox: Copying firefox-specific files"
cp platform/firefox/*.js $DES/js/

cp platform/thunderbird/manifest.json $DES/
cp platform/firefox/webext.js $DES/js/
cp platform/firefox/vapi-webrequest.js $DES/js/
echo "*** uBlock0.firefox: Copying thunderbird-specific files"
cp platform/thunderbird/manifest.json $DES/

# Firefox store-specific
cp -R $DES/_locales/nb $DES/_locales/no

# Firefox/webext-specific
rm $DES/img/icon_128.png
Expand Down

0 comments on commit a4aced6

Please sign in to comment.