This repository has been archived by the owner on Sep 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
uBlock 0.9.5.7 with pure Firefox WebExtension support
- Loading branch information
1 parent
b754c35
commit 5f2f710
Showing
7 changed files
with
74 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
import json | ||
import re | ||
import sys | ||
|
||
if len(sys.argv) == 1 or not sys.argv[1]: | ||
raise SystemExit('Build dir missing.') | ||
|
||
proj_dir = os.path.join(os.path.split(os.path.abspath(__file__))[0], '..') | ||
build_dir = os.path.abspath(sys.argv[1]) | ||
|
||
chromium_manifest = {} | ||
webext_manifest = {} | ||
|
||
chromium_manifest_file = os.path.join(proj_dir, 'platform', 'chromium', 'manifest.json') | ||
with open(chromium_manifest_file) as f1: | ||
chromium_manifest = json.load(f1) | ||
|
||
webext_manifest_file = os.path.join(build_dir, 'manifest.json') | ||
with open(webext_manifest_file) as f2: | ||
webext_manifest = json.load(f2) | ||
|
||
webext_manifest['version'] = chromium_manifest['version'] | ||
|
||
with open(webext_manifest_file, 'w') as f2: | ||
json.dump(webext_manifest, f2, indent=2, separators=(',', ': '), sort_keys=True) | ||
f2.write('\n') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# This script assumes a linux environment | ||
|
||
echo "*** uBlock.webext: Creating web store package" | ||
echo "*** uBlock.webext: Copying files" | ||
|
||
DES=dist/build/uBlock.webext | ||
rm -rf $DES | ||
mkdir -p $DES | ||
|
||
cp -R assets $DES/ | ||
rm $DES/assets/*.sh | ||
cp -R src/css $DES/ | ||
cp -R src/img $DES/ | ||
cp -R src/js $DES/ | ||
cp -R src/lib $DES/ | ||
cp -R src/_locales $DES/ | ||
cp -R $DES/_locales/nb $DES/_locales/no | ||
cp src/*.html $DES/ | ||
cp -R platform/chromium/img $DES/ | ||
cp platform/chromium/*.js $DES/js/ | ||
cp platform/chromium/*.html $DES/ | ||
cp platform/chromium/*.json $DES/ | ||
cp LICENSE.txt $DES/ | ||
|
||
cp platform/webext/manifest.json $DES/ | ||
mv $DES/img/icon_128.png $DES/icon.png | ||
|
||
echo "*** uBlock.webext: Generating meta..." | ||
python tools/make-webext-meta.py $DES/ | ||
|
||
if [ "$1" = all ]; then | ||
echo "*** uBlock.webext: Creating package..." | ||
pushd $DES > /dev/null | ||
zip ../$(basename $DES).xpi -qr * | ||
popd > /dev/null | ||
fi | ||
|
||
echo "*** uBlock.webext: Package done." |