Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
uBlock 0.9.5.7 with pure Firefox WebExtension support
Browse files Browse the repository at this point in the history
  • Loading branch information
uBlockAdmin committed Jun 14, 2018
1 parent b754c35 commit 5f2f710
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ env:
matrix:
- BROWSER=chromium EXT=zip
- BROWSER=firefox EXT=xpi
- BROWSER=embed-webext EXT=xpi
- BROWSER=webext EXT=xpi
script: ./tools/make-${BROWSER}.sh all
deploy:
provider: releases
Expand Down
2 changes: 1 addition & 1 deletion platform/chromium/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,

"name": "uBlock",
"version": "0.9.5.6",
"version": "0.9.5.7",

"default_locale": "en",
"description": "__MSG_extShortDesc__",
Expand Down
1 change: 1 addition & 0 deletions platform/chromium/options_ui.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!DOCTYPE html>
<html>
<head>
<script src="js/vapi-client.js"></script>
<script src="js/options_ui.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion platform/webext/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,

"name": "uBlock",
"version": "0.9.5.6",
"version": "0.9.5.7",

"applications": {
"gecko": {
Expand Down
13 changes: 1 addition & 12 deletions src/js/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ var fromFetch = function(to, fetched) {
}
};

var onSelectedFilterListsLoaded = function() {
return function() {
µb.assets.remoteFetchBarrier += 1;

var fetchableProps = {
Expand All @@ -281,17 +281,6 @@ var onSelectedFilterListsLoaded = function() {
vAPI.storage.preferences.get(fetchableProps, onPrefFetchReady);
};

return function() {
if ( typeof µb.migrateLegacyData === 'function' ) {
µb.migrateLegacyData(function() {
onSelectedFilterListsLoaded();
});
}
else {
onSelectedFilterListsLoaded();
}
};

})();

/******************************************************************************/
Expand Down
29 changes: 29 additions & 0 deletions tools/make-webext-meta.py
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')
40 changes: 40 additions & 0 deletions tools/make-webext.sh
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."

0 comments on commit 5f2f710

Please sign in to comment.