diff options
author | seenxu <seen_xu@msn.com> | 2019-07-03 13:38:22 +0200 |
---|---|---|
committer | seenxu <seen_xu@msn.com> | 2019-07-05 08:37:23 +0200 |
commit | 952aa244365085fac5d87975b7749343c4b08a31 (patch) | |
tree | 883bd34a894042d6b35d14ac2ea475347ad5b079 /common/modules | |
parent | 32c6ad3edbd2df0fb654bc1df0385ddb1f9a3a61 (diff) | |
download | pentadactyl-952aa244365085fac5d87975b7749343c4b08a31.tar.gz |
fix gi focus input field issue and elem[0] error
Diffstat (limited to 'common/modules')
-rw-r--r-- | common/modules/buffer.jsm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/common/modules/buffer.jsm b/common/modules/buffer.jsm index ce11fbd8..a8895a7c 100644 --- a/common/modules/buffer.jsm +++ b/common/modules/buffer.jsm @@ -2418,7 +2418,13 @@ var Buffer = Module("Buffer", { let elements = Array.from(frames) .flatMap(win => DOM.XPath(xpath, win.document)) - .filter(elem => { + .flatMap(elems => { + var _tmp=[]; + for(var i=0; i<elems.snapshotLength; i++) { + _tmp.push(elems.snapshotItem(i)); + } + return _tmp; + }).filter(elem => { if (isinstance(elem, [Ci.nsIDOMHTMLFrameElement, Ci.nsIDOMHTMLIFrameElement])) @@ -2426,7 +2432,7 @@ var Buffer = Module("Buffer", { elem = DOM(elem); - if (elem[0].readOnly || elem[0].disabled || !DOM(elem).isEditable) + if (!elem || !elem.length || elem[0].readOnly || elem[0].disabled || !DOM(elem).isEditable) return false; let style = elem.style; |