Closed
Bug 141717
Opened 23 years ago
Closed 22 years ago
function getSelection() breaks context menus
Categories
(Core :: XUL, defect)
Core
XUL
Tracking
()
RESOLVED
FIXED
People
(Reporter: caillon, Assigned: caillon)
References
()
Details
Attachments
(1 file)
1.43 KB,
patch
|
Biesinger
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
If a page tries to write its own |function getSelection()| context menus will
break since it uses getSelection for the "Search engine" context menu item.
Mozilla should either prevent users over-writing this, or not break context
menus. See also bug 141716 for fixing Bugzilla to not use that method.
Comment 1•23 years ago
|
||
There's nothing that can be done about this in the DOM, the code that deals with
the context menus can work around this to be certain (or more so at least)
they're calling the right method. The "right" getSelection() method can be found
on the window object's prototype even if a webpage defines its own function
named getSelection. To do this, the context menu code can do something like this
(not exactly clean, but we don't have much better options here):
window.__proto__.getSelection.call(window);
Assignee: jst → jaggernaut
Component: DOM Level 0 → XP Toolkit/Widgets
QA Contact: desale → jrgm
Comment 2•22 years ago
|
||
jst's workaround might be useful for other chrome javascript that interacts with
the page's window object. See bug 36946 (still security-sensitive!?) for
related discussion.
Assignee | ||
Comment 3•22 years ago
|
||
Yeah this works I guess. Also fixes a problem where we reference an undefined
property (this.onMetaDataItem).
Comment 5•22 years ago
|
||
Comment on attachment 90364 [details] [diff] [review]
Patch v.1.0
r=biesi
Attachment #90364 -
Flags: review+
Comment 6•22 years ago
|
||
Comment on attachment 90364 [details] [diff] [review]
Patch v.1.0
sr=jst
Attachment #90364 -
Flags: superreview+
Assignee | ||
Comment 7•22 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•