Created attachment 477379 [details] [diff] [review] WIP This idea is copied from the stock Android Browser: http://www.google.com/codesearch?hl=en&q=closeOnExit+package:%22git://android.git.kernel.org/platform/packages/apps/Browser.git%22&sa=N&cd=1&ct=rm&filter=0p If you open a new tab in Fennec from another app, then return to that app with the back button, Fennec should close the new tab. Example: 1. Click on a link in the Twitter app to open a page in Fennec. 2. Press the back button to return to the Twitter app. 3. Repeat steps 1-2 a dozen times. Expected results: Fennec ends up with the same number of tabs it started with. Actual results: Fennec has a dozen additional tabs open.
Created attachment 477394 [details] [diff] [review] patch This is a direct port of the Android browser's behavior. This also matches the behavior of the Back button in other Android apps, where pressing "back" ends the current activity and returns the user to the activity that opened it. However, since Fennec makes it easier to view and manage open tabs, maybe we don't need to be so aggressive. For example, we might want to clear the closeOnExit flag if the user switches tabs or opens a new tab manually. Or we might choose never to close tabs on "back", and instead let the user choose whether to clean them up the next time she uses Fennec.
Comment on attachment 477394 [details] [diff] [review] patch So this patch explicitly separates the "has owner" state from the "externally opened" state. This is a cleaner approach and allows us to be flexible if we what to.
Attachment #477394 - Flags: review?(mark.finkle) → review+
Comment on attachment 477394 [details] [diff] [review] patch This is fine; I like Matt's suggestion that as soon as the user switches tabs or performs a navigation task, we should start making the back button work as a normal back button, not as a "close that tab I just opened and return to my application." Basically, if the taskflow is: - click on link - start browsing the web - ANDROID_BACK then ANDROID_BACK should act like a web browser back button. As opposed to - click on link - ANDROID_BACK which should return you to the launching app.
Attachment #477394 - Flags: ui-review?(beltzner) → ui-review+
Pushed: http://hg.mozilla.org/mobile-browser/rev/ee53f05462e6 (In reply to comment #3) > - click on link > - start browsing the web > - ANDROID_BACK > > then ANDROID_BACK should act like a web browser back button. Yup, that is the the case with this patch.
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Everything works as expected on the latest Nightly build. Verified fixed on: Mozilla/5.0 (Android;Linux armv7l;rv:9.0a1)Gecko/20110913 Firefox/9.0a1 Fennec/9.0a1 Device: Samsung Galaxy S OS: Android 2.2
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.