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

VERIFIED FIXED in Firefox 15

Status

()

Firefox for Android
General
VERIFIED FIXED
5 years ago
9 months ago

People

(Reporter: xti, Assigned: Margaret)

Tracking

Trunk
Firefox 16
ARM
Android
Points:
---

Firefox Tracking Flags

(firefox15 fixed, firefox16 verified)

Details

Attachments

(2 attachments)

(Reporter)

Description

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 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: 695172
(Assignee)

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
(Reporter)

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.
(Assignee)

Comment 4

5 years ago
Created attachment 640804 [details] [diff] [review]
patch

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)
(Assignee)

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 (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+
(Assignee)

Comment 7

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/743769226802
https://hg.mozilla.org/integration/mozilla-inbound/rev/29b823147b88
Target Milestone: --- → Firefox 16
(Assignee)

Comment 8

5 years ago
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?
https://hg.mozilla.org/mozilla-central/rev/743769226802
https://hg.mozilla.org/mozilla-central/rev/29b823147b88
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
(Reporter)

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: RESOLVED → VERIFIED
status-firefox16: --- → verified

Updated

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

Comment 11

5 years ago
https://hg.mozilla.org/releases/mozilla-aurora/rev/84dd961ac565
status-firefox15: --- → fixed
You need to log in before you can comment on or make changes to this bug.