Opened 11 months ago

Closed 4 weeks ago

Last modified 2 weeks ago

#25013 closed defect (fixed)

Move TorButton code to the tor browser repository

Reported by: igt0 Owned by: tbb-team
Priority: Very High Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: tbb-mobile, TBA-a2, TorBrowserTeam201811R
Cc: arthuredelstein, dmr Actual Points:
Parent ID: #10760 Points:
Reviewer: gk, sysrqb, mcs Sponsor: Sponsor8

Description

As discussed in the[1], this is the first step to make the tor button to work on mobile.

[1] https://lists.torproject.org/pipermail/tbb-dev/2018-January/000740.html

Child Tickets

Attachments (2)

Change History (68)

comment:1 Changed 11 months ago by igt0

Parent ID: #24855

comment:2 Changed 11 months ago by igt0

Status: newneeds_review

The code can be seen here: https://github.com/igortoliveira/tor-browser/commits/tbb-dev-desktop:

Move Tor Button source code to the browser/extensions directory
https://github.com/igortoliveira/tor-browser/commit/eb2e1cec3b027647d3a873e8ce2e18102c926b7f

Integrate Tor Button in the browser build system
https://github.com/igortoliveira/tor-browser/commit/d41ab6c701cbcaf00512061b05fb1e5e106a0923

Use anonymous function to keep the torbutton.js and prefereces.js scope limited to the parent function
https://github.com/igortoliveira/tor-browser/commit/2c09ab0d4010c78af52a5655d865971600a215ed

Initialize startup.homepage in the startup-observer component
https://github.com/igortoliveira/tor-browser/commit/b73742421735d6fea70ba4d7d550dcea22c1642c


comment:3 Changed 11 months ago by igt0

Reviewer: gk, sysrqb, mcs

comment:4 Changed 11 months ago by gk

Keywords: TorBrowserTeam201801R added

Good stuff! FWIW: we'd need a tor-browser-build patch, too, I guess making sure that Torbutton is not built anymore and not shipped as an extension anymore in Tor Browser.

comment:5 in reply to:  4 Changed 11 months ago by igt0

Created a patch removing torbutton from the tor-browser-build.

Remove torbutton from the tor browser build
https://github.com/igortoliveira/tor-browser-build/commit/146a721e91232e4fee31dd343d4e1bfeee9b3a3a

Replying to gk:

Good stuff! FWIW: we'd need a tor-browser-build patch, too, I guess making sure that Torbutton is not built anymore and not shipped as an extension anymore in Tor Browser.

comment:6 Changed 11 months ago by arthuredelstein

Reviewer: gk, sysrqb, mcsgk, sysrqb, mcs, arthuredelstein

comment:7 Changed 11 months ago by arthuredelstein

Cc: arthuredelstein added
Reviewer: gk, sysrqb, mcs, arthuredelsteingk, sysrqb, mcs,

comment:8 in reply to:  2 Changed 10 months ago by igt0

I updated the code with the latest changes in Tor button, here are the new commits:

Move Tor Button source code to the browser/extensions directory
https://github.com/igortoliveira/tor-browser/commit/94279657dd8f0a4c999814155633ffe5d1b1d421


Integrate Tor Button in the browser build system
https://github.com/igortoliveira/tor-browser/commit/6813ba382253fd5b031bb1602cf64ce214bd274a


Use anonymous function to keep the torbutton.js and prefereces.js scope limited to the parent function
https://github.com/igortoliveira/tor-browser/commit/7c77dc04844fabb2ed8ed7e4d22edc1df03b76e9


Initialize startup.homepage in the startup-observer component
https://github.com/igortoliveira/tor-browser/commit/a4c6a58d287b87d8dd0736d67d7be6e87e3a30ab

Replying to igt0:

The code can be seen here: https://github.com/igortoliveira/tor-browser/commits/tbb-dev-desktop:

Move Tor Button source code to the browser/extensions directory
https://github.com/igortoliveira/tor-browser/commit/eb2e1cec3b027647d3a873e8ce2e18102c926b7f

Integrate Tor Button in the browser build system
https://github.com/igortoliveira/tor-browser/commit/d41ab6c701cbcaf00512061b05fb1e5e106a0923

Use anonymous function to keep the torbutton.js and prefereces.js scope limited to the parent function
https://github.com/igortoliveira/tor-browser/commit/2c09ab0d4010c78af52a5655d865971600a215ed

Initialize startup.homepage in the startup-observer component
https://github.com/igortoliveira/tor-browser/commit/b73742421735d6fea70ba4d7d550dcea22c1642c


comment:9 Changed 10 months ago by gk

Keywords: TorBrowserTeam201802 added; TorBrowserTeam201801R removed
Status: needs_reviewneeds_revision

Okay, I just compiled bundles with all the patches.

One thing for the tor-browser-build one: Could you add the bug number in front of your commit message like "Bug 25013:"?

For the browser patches:

1) I don't see the Torbutton icon on the toolbar button.
2) The arrow warning me that my version out-of-date is not visible either.

That's on a 64bit Linux box.

comment:10 Changed 10 months ago by gk

Oh, and please for the browser patches a "Bug 25013:" in front as well.

comment:11 in reply to:  9 Changed 10 months ago by gk

Replying to gk:

Okay, I just compiled bundles with all the patches.

One thing for the tor-browser-build one: Could you add the bug number in front of your commit message like "Bug 25013:"?

For the browser patches:

1) I don't see the Torbutton icon on the toolbar button.
2) The arrow warning me that my version out-of-date is not visible either.

Those two might actually not be your fault. It turns out that patch does not like the git binary diffs and seems to ignore the images in the Linux case + breaks the Windows builds. Let me try to test your patches differently tomorrow.

Last edited 10 months ago by gk (previous) (diff)

comment:12 in reply to:  10 Changed 10 months ago by igt0

Update commit messages:

Tor Browser Build:

Bug 25013: Remove torbutton from the tor browser build
https://github.com/igortoliveira/tor-browser-build/commit/9fd151714fe5d992d9cce12e3bb59259eea154d2

Tor Browser:

Bug 25013: Move Tor Button source code to the browser/extensions directory
https://github.com/igortoliveira/tor-browser/commit/910da3b9edb7068a1084443e75653487997bd978

Bug 25013: Integrate Tor Button in the browser build system
https://github.com/igortoliveira/tor-browser/commit/e931e6ae94c5a884b6f2c8ccb96568ffff952bcd

Bug 25013: Use anonymous function to keep the torbutton.js and preferences.js scope limited to the parent function
https://github.com/igortoliveira/tor-browser/commit/16c360da0b7edc0218fdeac7e5300f83e9bbc0a6

Bug 25013: Initialize startup.homepage in the startup-observer component
https://github.com/igortoliveira/tor-browser/commit/a28341162bf034299f4b060098e62cf515716e37

Replying to gk:

Oh, and please for the browser patches a "Bug 25013:" in front as well.

comment:13 Changed 10 months ago by gk

Keywords: TorBrowserTeam201802R added; TorBrowserTeam201802 removed
Status: needs_revisionneeds_review

comment:14 Changed 10 months ago by igt0

Updated the code:

Tor Browser Build:

Bug 25013: Remove torbutton from the tor browser build
https://github.com/igortoliveira/tor-browser-build/commit/9fd151714fe5d992d9cce12e3bb59259eea154d2

Tor Browser:

Bug 25013: Move Tor Button source code to the browser/extensions directory
https://github.com/igortoliveira/tor-browser/commit/910da3b9edb7068a1084443e75653487997bd978

Bug 25013: Integrate Tor Button in the browser build system
https://github.com/igortoliveira/tor-browser/commit/e931e6ae94c5a884b6f2c8ccb96568ffff952bcd

Bug 25013: Use anonymous function to keep the torbutton.js and preferences.js scope limited to the parent function
https://github.com/igortoliveira/tor-browser/commit/16c360da0b7edc0218fdeac7e5300f83e9bbc0a6

Bug 25013: Initialize startup.homepage in the startup-observer component
https://github.com/igortoliveira/tor-browser/commit/a28341162bf034299f4b060098e62cf515716e37

Bug 25013: Add translation tool
https://github.com/igortoliveira/tor-browser/commit/18b32a5144aa915327cf4584873bcb25a18b625e

comment:15 Changed 10 months ago by gk

Status: needs_reviewneeds_information

I am wondering what your plan is regarding the current Torbutton repository and where future development should happen (until we have all things we need in the browser and there in a non-extension-environment). Do you think we should get rid of the Torbutton repo as we currently have it and do Torbutton development directly in Tor Browser? Or what is the model you have in mind here?

Last edited 10 months ago by gk (previous) (diff)

comment:16 in reply to:  15 ; Changed 10 months ago by igt0

The idea is deprecate the tor button repository(we should keep it just for historical reasons) and move the whole tor button development to tor-browser.

Replying to gk:

I am wondering what your plan is regarding the current Torbutton repository and where future development should happen (until we have all things we need in the browser and there in a non-extension-environment). Do you think we should get rid of the Torbutton repo as we currently have it and do Torbutton development directly in Tor Browser? Or what is the model you have in mind here?

comment:17 in reply to:  16 ; Changed 10 months ago by arthuredelstein

Replying to igt0:

The idea is deprecate the tor button repository(we should keep it just for historical reasons) and move the whole tor button development to tor-browser.

This was my original thinking as well, but sysrqb's investigations in #25260 make me wonder if we wouldn't be better off finding a way to keep separate repositories for torbutton and tor-launcher. Perhaps we can find a way to either make them system addons ("feature" XPIs), or internal JS modules that are copied into the tor-browser.git tree at build time.

The advantage of maintaining separate torbutton and tor-launcher repositories is that we retain commit history (including the history we will accumulate for future commits). The tor-browser.git repository specifically is not so good for retaining history because we are constantly rebasing the patches to new versions of Firefox.

comment:18 in reply to:  17 Changed 10 months ago by gk

Keywords: TorBrowserTeam201802 added; TorBrowserTeam201802R removed
Status: needs_informationneeds_revision

Replying to arthuredelstein:

Replying to igt0:

The idea is deprecate the tor button repository(we should keep it just for historical reasons) and move the whole tor button development to tor-browser.

This was my original thinking as well, but sysrqb's investigations in #25260 make me wonder if we wouldn't be better off finding a way to keep separate repositories for torbutton and tor-launcher. Perhaps we can find a way to either make them system addons ("feature" XPIs), or internal JS modules that are copied into the tor-browser.git tree at build time.

The advantage of maintaining separate torbutton and tor-launcher repositories is that we retain commit history (including the history we will accumulate for future commits). The tor-browser.git repository specifically is not so good for retaining history because we are constantly rebasing the patches to new versions of Firefox.

+1 to that.

comment:19 Changed 10 months ago by gk

FWIW: I can see us copying over files from the Torbutton repo or just package up an .xpi and put the extracted files into tor-browser.git before we tag (and use the machinery developed in some of the patches above). I just think that step 1 of the migration should not contain getting rid of the Torbutton repo. We should do this once we integrate the components we need tighter into the browser. I guess this would be a thing, at some point, for step 3 in Arthur's staged approach.

comment:20 in reply to:  19 ; Changed 10 months ago by igt0

Status: needs_revisionneeds_review

I followed the same approach in the #25260, torbutton will work as a feature extension, so we still need to change the browser adding it as a subdirectory(git submodule?).
The changes in the tor button are related to the build system and making it work with the mozilla central code base(few things changed and others are deprecated).

bug 25013: Add Gecko build system infrastructure into tor button
https://github.com/igortoliveira/torbutton/commit/ef153a43363ee0714f6187b545494161bea96610

bug 25013: Migrate general.useragent.locale to intl.locale.requested
https://github.com/igortoliveira/torbutton/commit/40682676e33570d464534adc07bf94acb36a76fe

bug 25013: Update deprecated JS code
https://github.com/igortoliveira/torbutton/commit/1b50773f87465643ab8aed8104fa0c9a0fa5e0f5

bug 25013: Update XPCOM calls after changes in the interfaces
https://github.com/igortoliveira/torbutton/commit/a35a746ca206706f4c5742d70bc90b649c1bfdf0

Replying to gk:

FWIW: I can see us copying over files from the Torbutton repo or just package up an .xpi and put the extracted files into tor-browser.git before we tag (and use the machinery developed in some of the patches above). I just think that step 1 of the migration should not contain getting rid of the Torbutton repo. We should do this once we integrate the components we need tighter into the browser. I guess this would be a thing, at some point, for step 3 in Arthur's staged approach.

comment:21 Changed 10 months ago by gk

Keywords: TorBrowserTeam201802R added; TorBrowserTeam201802 removed

comment:22 Changed 9 months ago by gk

Keywords: TorBrowserTeam201803R added; TorBrowserTeam201802R removed

Moving our reviews to March 2018

comment:23 in reply to:  20 Changed 9 months ago by arthuredelstein

Status: needs_reviewneeds_revision

Replying to igt0:

I followed the same approach in the #25260, torbutton will work as a feature extension, so we still need to change the browser adding it as a subdirectory(git submodule?).

Hi, Igor -- do you think torbutton could continue to be built independently inside the torbutton.git repo, and then copied as an .xpi into the Tor Browser Bundle by tor-browser-build.git? I'm wondering if can avoid adding the gecko build infrastructure.

The changes in the tor button are related to the build system and making it work with the mozilla central code base(few things changed and others are deprecated).

bug 25013: Add Gecko build system infrastructure into tor button
https://github.com/igortoliveira/torbutton/commit/ef153a43363ee0714f6187b545494161bea96610

bug 25013: Migrate general.useragent.locale to intl.locale.requested
https://github.com/igortoliveira/torbutton/commit/40682676e33570d464534adc07bf94acb36a76fe

bug 25013: Update deprecated JS code
https://github.com/igortoliveira/torbutton/commit/1b50773f87465643ab8aed8104fa0c9a0fa5e0f5

bug 25013: Update XPCOM calls after changes in the interfaces
https://github.com/igortoliveira/torbutton/commit/a35a746ca206706f4c5742d70bc90b649c1bfdf0

I posted some comments on github.

comment:24 Changed 9 months ago by gk

Parent ID: #24855#10760

comment:25 Changed 9 months ago by gk

Keywords: TorBrowserTeam201803 added; TorBrowserTeam201803R removed

I agree with Arthur (I have not looked at the Github commits but meant to +1 the bundling of the .xpi in the Torbutton repo and then getting that copied into the browser part later on.)

Last edited 9 months ago by gk (previous) (diff)

comment:26 in reply to:  25 Changed 9 months ago by igt0

sysrqb wrote about the downsides of trying to build the .xpi outside the tor-browser repo:

https://trac.torproject.org/projects/tor/ticket/25260#comment:11

I also updated the code fixing arthur's comments:

bug 25013: Add Gecko build system infrastructure into tor button
https://github.com/igortoliveira/torbutton/commit/86fc5398a573a43620ec3023d92207ce63def278

bug 25013: Migrate general.useragent.locale to intl.locale.requested
https://github.com/igortoliveira/torbutton/commit/b8443a3e75ed59283bdd52b875625534be1b96b7

bug 25013: Update deprecated JS code
https://github.com/igortoliveira/torbutton/commit/1b51d8afc0be10bf363b5387dbbfcd75ee021161

bug 25013: Update XPCOM calls after changes in the interfaces
https://github.com/igortoliveira/torbutton/commit/c68eea2c04d24e3cb47f707620365da1dbe8c7b2

bug 25013: Initialize startup.homepage in the startup-observer component
https://github.com/igortoliveira/torbutton/commit/cfef8182c6a5b4a294da98f0a5e71d80ce6f6472

Replying to gk:

I agree with Arthur (I have not looked at the Github commits but meant to +1 the bundling of the .xpi in the Torbutton repo and then getting that copied into the browser part later on.)

comment:27 Changed 8 months ago by gk

Keywords: TorBrowserTeam201804 added; TorBrowserTeam201803 removed

Moving our tickets to April.

comment:28 Changed 8 months ago by gk

Priority: MediumHigh

comment:29 Changed 7 months ago by gk

Keywords: TorBrowserTeam201805 added; TorBrowserTeam201804 removed

Move our roadmap tickets to May.

comment:30 Changed 7 months ago by arthuredelstein

Keywords: ff60-esr added

comment:31 Changed 6 months ago by dmr

Cc: dmr added
Keywords: tbb-mobile added

comment:32 Changed 6 months ago by gk

Keywords: TorBrowserTeam201806 added; TorBrowserTeam201805 removed

comment:33 Changed 5 months ago by gk

Keywords: TorBrowserTeam201807 added; TorBrowserTeam201806 removed

Moving first batch of tickets to July 2018

comment:34 Changed 4 months ago by gk

Keywords: TorBrowserTeam201808 added; TorBrowserTeam201807 removed

Move our tickets to August.

comment:35 Changed 3 months ago by gk

Keywords: ff60-esr removed

comment:36 Changed 3 months ago by gk

Keywords: TorBrowserTeam201809 added; TorBrowserTeam201808 removed

Moving our tickets to September 2018

comment:37 Changed 2 months ago by gk

Keywords: TorBrowserTeam201810 added; TorBrowserTeam201809 removed

Moving tickets to October

comment:38 Changed 7 weeks ago by igt0

Status: needs_revisionneeds_review

These two patches are the first steps to move tor button to firefox, it adds a new file called jar.mn that generates the chrome.manifest and update the code removing an unecessary import.

bug 25013: Add Gecko build system infrastructure into tor button
https://github.com/igortoliveira/torbutton/commit/a86d5bbea745ff41e072a049994161eeca642e01

bug 25013: Remove non needed import, it is already available in the window object
https://github.com/igortoliveira/torbutton/commit/ceba9655fff4e454bb0c4003d4d3e849abb5033c

The next step is adding torbutton as submodule in the toolkit directory and update its moz.build file.

comment:39 in reply to:  38 ; Changed 7 weeks ago by gk

Status: needs_reviewnew

Replying to igt0:

These two patches are the first steps to move tor button to firefox, it adds a new file called jar.mn that generates the chrome.manifest and update the code removing an unecessary import.

bug 25013: Add Gecko build system infrastructure into tor button
https://github.com/igortoliveira/torbutton/commit/a86d5bbea745ff41e072a049994161eeca642e01

bug 25013: Remove non needed import, it is already available in the window object
https://github.com/igortoliveira/torbutton/commit/ceba9655fff4e454bb0c4003d4d3e849abb5033c

The next step is adding torbutton as submodule in the toolkit directory and update its moz.build file.

I guess you have that outlined in your proposal but why toolkit and not the browser directory where all the other extensions are? Let's clear review for now as other, crucial pieces are missing. The review of the parts above might depend on them being available.

comment:40 in reply to:  39 ; Changed 7 weeks ago by igt0

I would expect the browser/ directory be more about Desktop stuff. I can be totally wrong about it.

Replying to gk:

Replying to igt0:

These two patches are the first steps to move tor button to firefox, it adds a new file called jar.mn that generates the chrome.manifest and update the code removing an unecessary import.

bug 25013: Add Gecko build system infrastructure into tor button
https://github.com/igortoliveira/torbutton/commit/a86d5bbea745ff41e072a049994161eeca642e01

bug 25013: Remove non needed import, it is already available in the window object
https://github.com/igortoliveira/torbutton/commit/ceba9655fff4e454bb0c4003d4d3e849abb5033c

The next step is adding torbutton as submodule in the toolkit directory and update its moz.build file.

I guess you have that outlined in your proposal but why toolkit and not the browser directory where all the other extensions are? Let's clear review for now as other, crucial pieces are missing. The review of the parts above might depend on them being available.

comment:41 in reply to:  40 Changed 6 weeks ago by sysrqb

Replying to igt0:

The next step is adding torbutton as submodule in the toolkit directory and update its moz.build file.

I guess you have that outlined in your proposal but why toolkit and not the browser directory where all the other extensions are? Let's clear review for now as other, crucial pieces are missing. The review of the parts above might depend on them being available.

I would expect the browser/ directory be more about Desktop stuff. I can be totally wrong about it.

Yes, I think toolkit is a better location for this, too. We shouldn't add torbutton under browser/ if mobile/ needs it (which it does). It seems like toolkit/ is the directory for common browser functionality. If there is a better common directory, then I'm okay with using that, too.

I'll add review comments soon.

comment:42 Changed 6 weeks ago by gk

Keywords: TorBrowserTeam201810R added; TorBrowserTeam201810 removed
Status: newneeds_review

comment:43 Changed 6 weeks ago by gk

Status: needs_reviewneeds_information

toolkit/ is fine. Some questions that came to mind while looking over the changes

1) Do we really need the bug component part of the moz.build file? That is meant for Mozilla's Bugzilla I think which we won't use anyway.

2) Why is it not enough to just have something like

% locale torbutton @AB_CD@ %locale/@AB_CD@/

but do

#if AB_CD == en_US
 locale/@AB_CD@/		(src/chrome/locale/en/*)
#else
 locale/@AB_CD@/                (src/chrome/locale/@AB_CD@/*)
#endif

and treat en-US like a special case?

3) I was wondering whether we should move the jar.mn and moz.build files into the source directory given that essentially all extensions in the Mozilla tree I have looked at have both at the same level as install.rdf.in. Did you consider that?

comment:44 in reply to:  43 ; Changed 6 weeks ago by igt0

Replying to gk:

toolkit/ is fine. Some questions that came to mind while looking over the changes

1) Do we really need the bug component part of the moz.build file? That is meant for Mozilla's Bugzilla I think which we won't use anyway.

Awesome

2) Why is it not enough to just have something like

% locale torbutton @AB_CD@ %locale/@AB_CD@/

but do

#if AB_CD == en_US
 locale/@AB_CD@/		(src/chrome/locale/en/*)
#else
 locale/@AB_CD@/                (src/chrome/locale/@AB_CD@/*)
#endif

and treat en-US like a special case?

The mozilla locale handler doesn't have an "en" language. American english is defined as en_US. So we could rename the src/chrome/locale/en folder to en_US or do this workaround. (Other extensions do the same thing)

3) I was wondering whether we should move the jar.mn and moz.build files into the source directory given that essentially all extensions in the Mozilla tree I have looked at have both at the same level as install.rdf.in. Did you consider that?

No. However I think it is a good idea. I will update the patch.

comment:45 in reply to:  44 Changed 6 weeks ago by gk

Replying to igt0:

Replying to gk:

toolkit/ is fine. Some questions that came to mind while looking over the changes

1) Do we really need the bug component part of the moz.build file? That is meant for Mozilla's Bugzilla I think which we won't use anyway.

Awesome

2) Why is it not enough to just have something like

% locale torbutton @AB_CD@ %locale/@AB_CD@/

but do

#if AB_CD == en_US
 locale/@AB_CD@/		(src/chrome/locale/en/*)
#else
 locale/@AB_CD@/                (src/chrome/locale/@AB_CD@/*)
#endif

and treat en-US like a special case?

The mozilla locale handler doesn't have an "en" language. American english is defined as en_US. So we could rename the src/chrome/locale/en folder to en_US or do this workaround. (Other extensions do the same thing)

Are we sure "en" is the only locale in Torbutton as we ship it that is affected? That said, I think we should rather fix that issue than work around it (especially as we ship an *en-US* bundle and not an *en* one). I'll ping emmapeel for the translations related issue but hope it is not that hard to move to en-US. Otherwise we could add a symlink for now?

comment:46 Changed 6 weeks ago by gk

Keywords: TorBrowserTeam201810 added; TorBrowserTeam201810R removed

comment:47 Changed 6 weeks ago by gk

Okay, I filed #28261 for getting the language strings into "en-US" on the translations side.

comment:48 Changed 5 weeks ago by gk

Keywords: TorBrowserTeam201811 added; TorBrowserTeam201810 removed

Moving our tickets to November.

comment:49 Changed 5 weeks ago by igt0

Status: needs_informationneeds_review

Updated code: https://github.com/igortoliveira/torbutton/tree/25013-v1

I moved the jar.mn to the src/ folder and renamed the en/ locale to en-US.

comment:50 Changed 5 weeks ago by gk

Keywords: TorBrowserTeam201811R added; TorBrowserTeam201811 removed

comment:51 Changed 5 weeks ago by sysrqb

Related to the above locales, this allows including only one locale. Current we ship torbutton with localization for all locales (and tor browser only uses one of them). I'm not sure if we want to continue shipping all of them or this proposed patch is better for tor browser and we only select the locale of the browser.

I can see us wanting to ship torbutton with all locales within the multi-lingual builds, but I don't know if we should optimize for that right now.

Another question is whether we want this as a feature extension or as a system extension. Arthur made a good argument for a feature extension allowing easily copying a new torbutton*.xpi into the tor-browser dir, compared with a system extension that's bundled directly into to omni jar. The feature extension is a little more complicated, but maybe the additional flexibility is worth the added complexity.

This may already be known, but just so its documented...when testing this within tor-browser, we'll need something like this (assuming torbutton is places under toolkit/components/:

diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in
index 8a2a356c151c..5415d436acdd 100644
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -426,6 +426,10 @@
 @BINPATH@/chrome/devtools@JAREXT@
 @BINPATH@/chrome/devtools.manifest
 
+; Torbutton
+@BINPATH@/chrome/torbutton@JAREXT@
+@BINPATH@/chrome/torbutton.manifest
+
 ; [Default Preferences]
 ; All the pref files must be part of base to prevent migration bugs
 #ifdef MOZ_GECKOVIEW_JAR
diff --git a/toolkit/components/moz.build b/toolkit/components/moz.build
index 2bc8b12121f2..61a145335097 100644
--- a/toolkit/components/moz.build
+++ b/toolkit/components/moz.build
@@ -114,3 +114,6 @@ if CONFIG['NIGHTLY_BUILD'] and CONFIG['MOZ_BUILD_APP'] == 'browser':
 
 if CONFIG['MOZ_BUILD_APP'] == 'browser':
     DIRS += ['normandy']
+
+if CONFIG['MOZ_BUILD_APP'] == 'browser' or CONFIG['MOZ_BUILD_APP'] == 'mobile/android':
+    DIRS += ['torbutton']

comment:52 in reply to:  49 Changed 5 weeks ago by gk

Keywords: TorBrowserTeam201811 added; TorBrowserTeam201811R removed
Status: needs_reviewneeds_revision

Replying to igt0:

Updated code: https://github.com/igortoliveira/torbutton/tree/25013-v1

I moved the jar.mn to the src/ folder and renamed the en/ locale to en-US.

I don't think just renaming the folder is going to fly with our translations workflow. See e.g. the import-translations.sh script with the en pieces. Which is why I was thinking about some symlink until #28261 is figured out. Not sure whether that is working, though.

What about the bug component I mentioned in comment:43?

comment:53 Changed 5 weeks ago by gk

Keywords: TBA-a2 added
Priority: HighVery High

comment:54 Changed 5 weeks ago by igt0

I updated my branch:

https://github.com/igortoliveira/torbutton/commits/25013-v2

  • Added a symlink dir from en to en-US
  • Removed bug component from moz.build
  • Removed the locale hack from the jar.mn file
  • Instead of a system extension, now it is a feature extension

comment:55 Changed 5 weeks ago by igt0

Status: needs_revisionneeds_review

comment:56 Changed 4 weeks ago by igt0

Updated the code:

https://github.com/igortoliveira/torbutton/tree/25013-v3

Added a symlink dir from en to en-US
Removed bug component from moz.build
Removed the locale hack from the jar.mn file
I kept it as a system extension, i was having lot of issues trying to make the feature extension work on mobile. For now, there isn't any big advantage of having a feature extension.

comment:57 Changed 4 weeks ago by gk

Keywords: TorBrowserTeam201811R added; TorBrowserTeam201811 removed

comment:58 Changed 4 weeks ago by gk

Keywords: TorBrowserTeam201811 added; TorBrowserTeam201811R removed
Status: needs_reviewneeds_revision

We are close for that part I think. The last thing to fix, I think, is our crappy bundling shell script. We should not bundle both en and en-US when running ./makexpi.sh (assuming this is used for non-mobile platforms only anyway). Could you exclude the en-US folder?

comment:59 in reply to:  58 Changed 4 weeks ago by igt0

Status: needs_revisionneeds_review

I create a new branch:

https://github.com/igortoliveira/torbutton/tree/25013-v4

When the user uses the makexpi.sh, it doesn't zip the en-US folder.

Replying to gk:

We are close for that part I think. The last thing to fix, I think, is our crappy bundling shell script. We should not bundle both en and en-US when running ./makexpi.sh (assuming this is used for non-mobile platforms only anyway). Could you exclude the en-US folder?

comment:60 Changed 4 weeks ago by gk

Status: needs_reviewnew

Merged to master (commit 831c8bee11a464b42dcee9c84ad52fca07e5e241), thanks! Setting state to new for the remaining parts.

comment:61 Changed 4 weeks ago by igt0

Status: newneeds_review

comment:62 in reply to:  61 ; Changed 4 weeks ago by gk

Status: needs_reviewneeds_revision

Replying to igt0:

Patch for tor browser:

https://trac.torproject.org/projects/tor/attachment/ticket/25013/0001-Bug-25013-Add-torbutton-as-a-tor-browser-submodule.patch

Bug 25013: Add torbutton as a tor-browser submodule

This is essentially a fix for #27611 as you seem to indicate in your commit message? If so, lets mention that ticket there, too.

The submodule commit seems wrong. I can't check Torbutton out. I guess it should be ac8d9251494056e761bb2cf5c2a4795a888f38bd instead?

s/non restartless/non-restartless/

comment:63 in reply to:  62 Changed 4 weeks ago by igt0

Status: needs_revisionneeds_review

Yeah, oddly enough, the submodule was using an old git hash.

I updated the patch:

https://trac.torproject.org/projects/tor/attachment/ticket/25013/0001-Bug-25013-Add-torbutton-as-a-tor-browser-submodule.2.patch

  • Updated the submodule commit
  • Added a reference to the bug #27611

Replying to gk:

Replying to igt0:

Patch for tor browser:

https://trac.torproject.org/projects/tor/attachment/ticket/25013/0001-Bug-25013-Add-torbutton-as-a-tor-browser-submodule.patch

Bug 25013: Add torbutton as a tor-browser submodule

This is essentially a fix for #27611 as you seem to indicate in your commit message? If so, lets mention that ticket there, too.

The submodule commit seems wrong. I can't check Torbutton out. I guess it should be ac8d9251494056e761bb2cf5c2a4795a888f38bd instead?

s/non restartless/non-restartless/

comment:64 Changed 4 weeks ago by gk

Keywords: TorBrowserTeam201811R added; TorBrowserTeam201811 removed

comment:65 Changed 4 weeks ago by gk

Resolution: fixed
Reviewer: gk, sysrqb, mcs,gk, sysrqb, mcs
Status: needs_reviewclosed

Looks good, thanks! Cherry-picked to tor-browser-60.3.0esr-8.5-1 (fbccad5b7b28a975f2e9de73f8362fcf937db6aa).

comment:66 Changed 2 weeks ago by pili

Sponsor: Sponsor8
Note: See TracTickets for help on using tickets.