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

VERIFIED FIXED in Firefox 15



Firefox for Android
5 years ago
a year ago


(Reporter: xti, Assigned: Margaret)


Firefox 16

Firefox Tracking Flags

(firefox15 fixed, firefox16 verified)



(2 attachments)



5 years ago
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 
3. Open a new tab and go to
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: 695172

Comment 2

5 years ago
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

Comment 3

5 years ago
O Desktop Firefox, the Find in Page bar persists on each tab, so we could do something similar on Android side.

Comment 4

5 years ago
Created attachment 640804 [details] [diff] [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)

Comment 5

5 years ago
Created attachment 640807 [details] [diff] [review]
(cleanup) Use the browser's built-in fastFind property

We don't need to create our own find instance, since we get one for free with the browser ( 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]

>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 7

5 years ago
Target Milestone: --- → Firefox 16

Comment 8

5 years ago
Comment on attachment 640804 [details] [diff] [review]

[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?
Last Resolved: 5 years ago
Resolution: --- → FIXED

Comment 10

5 years ago
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-firefox16: --- → verified


5 years ago
Attachment #640804 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+

Comment 11

5 years ago
status-firefox15: --- → fixed
You need to log in before you can comment on or make changes to this bug.