Searching for the same word twice in a pdf is not working properly.
Categories
(Firefox :: PDF Viewer, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox81 | --- | verified |
People
(Reporter: VarCat, Assigned: mcccs)
References
Details
(Whiteboard: [pdfjs-c-ff-integration][pdfjs-d-text-search])
Attachments
(1 file)
Comment 1•12 years ago
|
||
| Reporter | ||
Comment 2•12 years ago
|
||
Updated•12 years ago
|
Suggested patch:
diff -r 3ad2fc2915b1 toolkit/content/widgets/findbar.js
--- a/toolkit/content/widgets/findbar.js Sat Jul 25 03:14:44 2020 +0000
+++ b/toolkit/content/widgets/findbar.js Sun Jul 26 14:52:24 2020 +0100
@@ -184,7 +184,7 @@
this._hadValue = true;
this._willfullyDeleted = false;
}
- this._find(value);
+ this._browser.finder.clipboardSearchString = value;
});
this._findField.addEventListener("keypress", event => {
diff -r 3ad2fc2915b1 toolkit/modules/Finder.jsm
--- a/toolkit/modules/Finder.jsm Sat Jul 25 03:14:44 2020 +0000
+++ b/toolkit/modules/Finder.jsm Sun Jul 26 14:52:24 2020 +0100
@@ -3,7 +3,9 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-var EXPORTED_SYMBOLS = ["Finder", "GetClipboardSearchString"];
+var EXPORTED_SYMBOLS = [
+ "Finder", "GetClipboardSearchString", "SetClipboardSearchString"
+];
const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
@@ -143,14 +145,7 @@
},
set clipboardSearchString(aSearchString) {
- if (!aSearchString || !Clipboard.supportsFindClipboard()) {
- return;
- }
-
- ClipboardHelper.copyStringToClipboard(
- aSearchString,
- Ci.nsIClipboard.kFindClipboard
- );
+ SetClipboardSearchString(aSearchString);
},
set caseSensitive(aSensitive) {
@@ -826,3 +821,15 @@
return searchString;
}
+
+function SetClipboardSearchString(aSearchString) {
+ console.log("Saving")
+ if (!aSearchString || !Clipboard.supportsFindClipboard()) {
+ return;
+ }
+
+ ClipboardHelper.copyStringToClipboard(
+ aSearchString,
+ Ci.nsIClipboard.kFindClipboard
+ );
+}
diff -r 3ad2fc2915b1 toolkit/modules/FinderParent.jsm
--- a/toolkit/modules/FinderParent.jsm Sat Jul 25 03:14:44 2020 +0000
+++ b/toolkit/modules/FinderParent.jsm Sun Jul 26 14:52:24 2020 +0100
@@ -23,6 +23,12 @@
ChromeUtils.defineModuleGetter(
this,
+ "SetClipboardSearchString",
+ "resource://gre/modules/Finder.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+ this,
"Rect",
"resource://gre/modules/Geometry.jsm"
);
@@ -231,6 +237,10 @@
return GetClipboardSearchString(this._browser.loadContext);
},
+ set clipboardSearchString(aSearchString) {
+ SetClipboardSearchString(aSearchString);
+ },
+
set caseSensitive(aSensitive) {
this._caseSensitive = aSensitive;
this.sendMessageToAllContexts("Finder:CaseSensitive", {
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 8•5 years ago
|
||
| bugherder | ||
Updated•5 years ago
|
Comment 9•5 years ago
|
||
Hi mcccs! I followed the steps from comment 2 on macOS 10.15, using an affected Nightly build 2020-08-15 (I couldn't open such old builds from mid 2014), but the search term is always found on the pdf sample in my case.
I'm wondering if these steps are still accurate, could you please let me know, so we can verify this fix?
| Assignee | ||
Comment 10•5 years ago
|
||
Hello, here are the steps I followed:
- Open a non-PDF page and Command + F and enter a word that is found in the page
- In a new tab open a PDF page and Command + F and enter a word that is found in the PDF
- Hit Command + F
- The textbox will be filled with the word from the non-PDF page which is unexpected since we intended to find the next occurrence of the text last entered.
PS: I have no idea how this has ever been reproducible on Linux. I have tried the 2014 Firefox on a Linux and could not reproduce it. The patch I made fixes a macOS-specific problem so I believe the issue had never existed on Linux. Of the commits in the pushlog, the 5 most suspicious ones (consecutive) added a feature for macOS only.
Comment 11•5 years ago
|
||
Great, thank you! I was able to reproduce the issue as well with your steps on mac 10.15, using an affected Nightly build from 2020-08-17.
The issue is verified as fixed on latest Beta 81.0b9, under mac 10.15.
Description
•