Opened 3 months ago

Last modified 3 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
Cc: sysrqb, gk Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

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.
         this._domains.clear();

         break;
       case "TabOpen":
         // Use opening a new tab as a trigger to expire the most stale tab.
         this.expireLruTab();
+
+        let tab = aEvent.target;
+        //tab.clientWidth
+        //tab.clientHeight
+        tab.style.margin = "50px";
         break;
     }
   },

   // 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 (1)

comment:1 Changed 3 months ago by sysrqb

Keywords: tbb-mobile added

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

Note: See TracTickets for help on using tickets.