Skip to content
Browse files

browser_element_focus: fix error with xul textboxes, xulrunner>=8

An error was dumped to console in XULRunner 8, if you open about:config in
a buffer and hit tab.

  TypeError: elem.wrappedJSObject is undefined
  chrome://conkeror/content/element.js:368
  browser_element_focus([object Object],[object XULElement])@chrome://conkeror/content/element.js:368
  ...
  Console error: [JavaScript Warning: "reference to undefined property elem.wrappedJSObject"
    {file: "chrome://conkeror/content/element.js" line: 368}]
  Category: chrome javascript
  • Loading branch information...
1 parent 4f81908 commit 7e3c994ce3a1d468dab6b54ae17acb11ad8db9f2 @retroj committed
Showing with 6 additions and 2 deletions.
  1. +6 −2 modules/element.js
View
8 modules/element.js
@@ -364,8 +364,12 @@ function browser_element_focus (buffer, elem) {
if (! dom_node_or_window_p(elem))
return;
- if (elem instanceof Ci.nsIDOMXULTextBoxElement)
- elem = elem.wrappedJSObject.inputField; // focus the input field
+ if (elem instanceof Ci.nsIDOMXULTextBoxElement) {
+ if (elem.wrappedJSObject)
+ elem = elem.wrappedJSObject.inputField; // focus the input field
+ else
+ elem = elem.inputField;
+ }
browser_set_element_focus(buffer, elem);
if (elem instanceof Ci.nsIDOMWindow)

0 comments on commit 7e3c994

Please sign in to comment.
Something went wrong with that request. Please try again.