Pier Angelo Vendrame pushed to branch main at The Tor Project / Applications /
tor-browser-build
Commits:
c5141d16 by Pier Angelo Vendrame at 2025-10-06T22:20:12+02:00
Bug 41577: Minify JS with UglifyJS on Android x86.
Firefox's minifier does not work with some modules, so we disabled it.
However, we still need to minify them on Android x86 so to make our
files smaller and acceptable by the Play Store.
- - - - -
5 changed files:
- projects/browser/build.android
- projects/browser/config
- + projects/uglifyjs/README.md
- + projects/uglifyjs/build
- + projects/uglifyjs/config
Changes:
=====================================
projects/browser/build.android
=====================================
@@ -2,6 +2,12 @@
[% c("var/set_default_env") -%]
[% pc(c('var/compiler'), 'var/setup', { compiler_tarfile =>
c('input_files_by_name/' _ c('var/compiler')) }) %]
+[% IF c("var/android-x86") -%]
+ tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/node') %]
+ export PATH=/var/tmp/dist/node/bin:$PATH
+ tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/uglifyjs') %]
+[% END -%]
+
# Bundle our extension(s).
#
# NoScript will be copied over to the profile folder
@@ -58,6 +64,11 @@ function generate_apk {
[% IF c("var/tor-browser") -%]
cp -a ../moat_countries.json ../tor/pluggable_transports/pt_config.json
chrome/toolkit/content/global/
[% END -%]
+ [% IF c("var/android-x86") -%]
+ find actors chrome modules moz-src \
+ -name '*.js' -or -name '*.mjs' \
+ -exec /var/tmp/dist/uglifyjs/bin/uglifyjs --in-situ {} \;
+ [% END -%]
[% c('zip', {
zip_src => [ '.' ],
zip_args => '-0 ../assets/omni.ja',
=====================================
projects/browser/config
=====================================
@@ -163,3 +163,9 @@ input_files:
# tor-browser-build#40920
- filename: sort-baseline.py
enable: '[% c("var/android") %]'
+ - project: node
+ name: node
+ enable: '[% c("var/android-x86") %]'
+ - project: uglifyjs
+ name: uglifyjs
+ enable: '[% c("var/android-x86") %]'
=====================================
projects/uglifyjs/README.md
=====================================
@@ -0,0 +1 @@
+This project fetches UglifyJS without any other changes.
=====================================
projects/uglifyjs/build
=====================================
@@ -0,0 +1,4 @@
+#!/bin/bash
+tar -xf [% project %]-[% c('version') %].tar.[% c('compress_tar') %]
+mv [% project %]-[% c('version') %] [% project %]
+tar -caf [% dest_dir %]/[% c("filename") %] [% project %]
=====================================
projects/uglifyjs/config
=====================================
@@ -0,0 +1,4 @@
+version: 3.19.3
+filename: 'uglifyjs-[% c("version") %]-[% c("var/build_id") %].tar.[%
c("compress_tar") %]'
+git_hash: 3ea33afc72462a470466473208a33379b7204765
+git_url: https://github.com/mishoo/UglifyJS.git
View it on GitLab:
https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/c5141d16d7ee956569010c16f43ca566981eae29
--
View it on GitLab:
https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/c5141d16d7ee956569010c16f43ca566981eae29
You're receiving this email because of your account on gitlab.torproject.org.
_______________________________________________
tbb-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]