Commit 106a5129 authored by segfault's avatar segfault
Browse files

Use new uBlock storage format (refs: #15702)

parent 3fc4fb47
#!/bin/sh
set -e
echo "Converting uBlock database dump into sqlite blob"
# Import ensure_hook_dependency_is_installed()
. /usr/local/lib/tails-shell-library/build.sh
ensure_hook_dependency_is_installed sqlite3
DUMP="/usr/share/tails/ublock-origin/ublock0.dump"
DATABASE="/etc/tor-browser/profile/extension-data/ublock0.sqlite"
mkdir -p "$(dirname "${DATABASE}")"
# The sed expression simply means: remove all CRLF ("\r\n"). The use
# of labels is simply to make this able to remove multiple CRLF to
# create a single (long) line. In the end, this restores the
# diff-friendly dump to the original sqlite dump.
sed ':a;N;$!ba;s_\r\n__g' "${DUMP}" | sqlite3 "${DATABASE}"
echo "Created uBlock sqlite blob successfully"
...@@ -164,20 +164,13 @@ The patterns+settings file is stored as a SQLite text dump in ...@@ -164,20 +164,13 @@ The patterns+settings file is stored as a SQLite text dump in
1. Start Tails 1. Start Tails
2. Start *Tor Browser* 2. Start *Tor Browser*
2. Click on the uBlock icon and then click on the gears icon to open 2. Click on the uBlock icon and then click on the preferences icon ("Open the dashboard") to open
the uBlock dashboard the uBlock dashboard
3. Open the *3rd-party filters* tab 3. Open the *Filter lists* tab
4. Click on the button *Update now* to update all filters 4. Click on the button *Update now* to update all filters
5. Close *Tor Browser* 5. Close *Tor Browser*
7. Copy the `.tor-browser/profile.default/extension-data/ublock0.sqlite` 7. Copy the `.tor-browser/profile.default/browser-extension-data/uBlock0@raymondhill.net/storage.js`
from this Tor Browser instance into the root of Tails' Git repo and from this Tor Browser instance to `config/chroot_local-includes/etc/tor-browser/profile/browser-extension-data/uBlock0@raymondhill.net/storage.js` in Tails' Git repo.
run the following command:
./bin/convert-ublock-settings ublock0.sqlite > \
config/chroot_local-includes/usr/share/tails/ublock-origin/ublock0.dump \
&& git commit -m 'Update uBlock Origin patterns + settings file.' \
config/chroot_local-includes/usr/share/tails/ublock-origin/ublock0.dump \
&& rm ublock0.sqlite
Upgrade bundled binary Debian packages Upgrade bundled binary Debian packages
-------------------------------------- --------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment