[tbb-bugs] #30945 [Applications/Tor Browser]: Port Letterboxing to TB for Android
Tor Bug Tracker & Wiki
blackhole at torproject.org
Sat Jun 22 14:59:10 UTC 2019
#30945: Port Letterboxing to TB for Android
------------------------------------------+----------------------
Reporter: tom | Owner: tbb-team
Type: defect | Status: new
Priority: Medium | Milestone:
Component: Applications/Tor Browser | Version:
Severity: Normal | Keywords:
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.
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.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/30945>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tbb-bugs
mailing list