Closed Bug 771997 Opened 12 years ago Closed 12 years ago

Find in Page doesn't work for more than one tab

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(firefox15 fixed, firefox16 verified)

VERIFIED FIXED
Firefox 16
Tracking Status
firefox15 --- fixed
firefox16 --- verified

People

(Reporter: xti, Assigned: Margaret)

References

Details

Attachments

(2 files)

Firefox 16.0a1 (2012-07-08)
Device: Asus EEE Transformer TF101
OS: Android 4.0.3

Steps to reproduce:
1. Open Fennec
2. Go to news.google.com 
3. Open a new tab and go to planet.mozilla.org
4. Go to Menu > Find in Page
5. Perform a search about "m" for example
6. Switch to the page opened at step 2
7. Tap on up/down arrow to find in page the search criteria from step 5

Expected result:
Find in Page still works after step 7.

Actual result:
No results are highlighted at step 7. Find in Page works only for the tab which was active when this feature was enabled.
Other browsers handle this by making find-in-page the foreground UI and limiting it to one tab.
Blocks: find
Do users want to perform the same search across multiple tabs? And do they expect the find bar to reappear when they come back to the tab that it was open in before? If the answer to either of those is yes, we should probably just fix the issue as described instead of dismissing it when switching tabs.
Assignee: nobody → margaret.leibovic
O Desktop Firefox, the Find in Page bar persists on each tab, so we could do something similar on Android side.
Attached patch patchSplinter Review
This is similar to what we were talking about doing for text selection. This clears the active find when switching tabs, but it won't close the find bar. If you switch tabs and hit one of the arrows, it will start a new find in that new tab. This matches what desktop does, although it won't persist the find from the previous tab (desktop does that).
Attachment #640804 - Flags: review?(mark.finkle)
We don't need to create our own find instance, since we get one for free with the browser (http://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/browser.xml#354). I also updated the variable name from _find to _fastFind for consistency with desktop code.
Attachment #640807 - Flags: review?(mark.finkle)
Comment on attachment 640804 [details] [diff] [review]
patch


>diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js

>   uninit: function() {
>     Services.obs.removeObserver(this, "FindInPage:Find", false);
>     Services.obs.removeObserver(this, "FindInPage:Prev", false);
>     Services.obs.removeObserver(this, "FindInPage:Next", false);
>     Services.obs.removeObserver(this, "FindInPage:Closed", false);
>+    Services.obs.removeObserver(this, "Tab:Selected", false);
>   },

Just some cleanup, but removeObserver does not take a third param. You can remove all of those.

"Tab:Selected" is called for adding and closing tabs too, so we should be covered in those cases too.
Attachment #640804 - Flags: review?(mark.finkle) → review+
Attachment #640807 - Flags: review?(mark.finkle) → review+
Comment on attachment 640804 [details] [diff] [review]
patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): issue with find in page, which is new in 15
User impact if declined: find in page gets into a broken state when switching tabs
Testing completed (on m-c, etc.): just landed on inbound
Risk to taking this patch (and alternatives if risky): low-risk, just cancels find when we switch tabs
String or UUID changes made by this patch: n/a
Attachment #640804 - Flags: approval-mozilla-aurora?
Find in Page works now on multi tabs. 
Closing bug as verified fixed on:

Firefox 16.0a1 (2012-07-11)
Device: Galaxy Nexus
OS: Android 4.0.4
Status: RESOLVED → VERIFIED
Attachment #640804 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: