Opened 14 months ago

Last modified 5 months ago

#30945 new defect

Port Letterboxing to TB for Android

Reported by: tom Owned by: tbb-team
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: tbb-mobile, tbb-parity
Cc: sysrqb, gk Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


I'm not sure what exactly you want to do here; but the following patch should get you some/most of the way once you figure it out...

diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -6735,16 +6735,21 @@ var Tabs = {
       case "pageshow":
         // Clear the domain cache whenever a page is loaded into any browser.

       case "TabOpen":
         // Use opening a new tab as a trigger to expire the most stale tab.
+        let tab =;
+        //tab.clientWidth
+        //tab.clientHeight
+ = "50px";

   // Manage the most-recently-used list of tabs. Each tab has a timestamp
   // associated with it that indicates when it was last touched.
   expireLruTab: function() {
     if (!this._enableTabExpiration) {

This is waaaaay more simple than Desktop. I'm not sure what cases we are not handling here; but since there's no resizing that makes it simpler. Rotating seems to work. It doesn't exempt privileged URLs like about:config but if we did do that then we would need to handle other events besides TabOpen and then add/remove the margin... It doesn't affect the new tab page. Anyway - it needs playing with and testing (as well as deciding how you want to letterbox) but at least we found the 'where'.

You can fiddle with this code using the Remote Debugging feature. (At least I can do it with Fennec in esr68.) If you haven't used it before:

Using Nightly (or Dev Edition) go to about:debugging on your desktop FF. Then in Fennec go to Settings -> Advanced -> Enable Remote Debugging via USB. Go back to about:debugging on the desktop, and you should be able to connect to Fennec on the left hand side. Scroll down to main processes and choose inspect. In the new tab that opens, go to Debugger, Control+P and find browser/content/browser.js and scroll down to line 6744-ish, and place your breakpoint. Now when you open a tab you should hit the breakpoint and can inspect the tab variable in the Console section.

Child Tickets

Change History (3)

comment:1 Changed 14 months ago by sysrqb

Keywords: tbb-mobile added

See also: #27083 (I suspect letterboxing is the better option on mobile).

comment:2 Changed 10 months ago by gk

Keywords: tbb-parity added

comment:3 Changed 5 months ago by Thorin

closed #33495 as a duplicate

Note: See TracTickets for help on using tickets.