Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Tor Browser Tor Browser
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 930
    • Issues 930
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 7
    • Merge requests 7
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Applications
  • Tor BrowserTor Browser
  • Issues
  • #30945

Port Letterboxing to TB for Android

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.

Assignee
Assign to
Time tracking