Closed
Bug 360331
Opened 19 years ago
Closed 13 years ago
getBrowserSelection() (context menu search) does not get text from input or textarea
Categories
(Firefox :: Search, defect)
Firefox
Search
Tracking
()
RESOLVED
DUPLICATE
of bug 565717
People
(Reporter: bugzilla, Assigned: bugzilla)
Details
Attachments
(1 file)
The browser.js function getBrowserSelection() does not return text from either input or textarea nodes, and this is limiting the scope of "Search <Engine> for <String>" on the context menu.
An easy fix would be something like this (untested, but I've implemented the same behaviour for the next release of Context Search):
var fElm = document.commandDispatcher.focusedElement;
if ((fElm instanceof HtmlInputElement && String.toLowerCase(fElm.type) == "text) || fElm instanceof HTMLTextAreaElement) {
return (fElm.selectionStart < fElm.selectionEnd) ? fElm.value.substring(fElm.selectionStart, fElm.selectionEnd) : null;
}
Comment 1•19 years ago
|
||
No need for the toLowerCase, the .type getter will always return a lowercased string.
Updated•19 years ago
|
Hardware: PC → All
Summary: getBrowserSelection() does not get text from input or textarea → getBrowserSelection() (context menu search) does not get text from input or textarea
Version: unspecified → Trunk
| Assignee | ||
Comment 2•19 years ago
|
||
Ah, I didn't know - thanks.
Comment 3•19 years ago
|
||
reported also in bug 125487 (at that time for suite of course)
| Assignee | ||
Comment 4•18 years ago
|
||
First stab at suggestion above.
Assignee: nobody → cusser.bugs
Status: NEW → ASSIGNED
Comment 5•18 years ago
|
||
Ben, you need to request review and/or cc someone on the bug if you want patch to be examined
Updated•13 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•