h || this.inQuickFind) { return this.FindBarContent.onKeypress(event); } if (event.charCode && this.shouldFastFind(event.target)) { let key = String.fromCharCode(event.charCode); if ((key == "/" || key == "'") && FindBarChild.manualFAYT) { return this.FindBarContent.startQuickFind(event); } if (key != " " && FindBarChild.findAsYouType) { return this.FindBarContent.startQuickFind(event, true); } } return null; } /** * Return true if we should FAYT for this node: * * @param elt * The element that is focused */ shouldFastFind(elt) { if (elt) { let win = elt.ownerGlobal; if (win.HTMLInputElement.isInstance(elt) && elt.mozIsTextField(false)) { return false; } if (elt.isContentEditable || win.document.designMode == "on") { return false; } if ( win.HTMLTextAreaElement.isInstance(elt) || win.HTMLSelectElement.isInstance(elt) || win.HTMLObjectElement.isInstance(elt) || win.HTMLEmbedElement.isInstance(elt) ) { return false; } if (win.XULFrameElement.isInstance(elt)) { // If we're targeting an embedded XULFrameElement // (e.g. about:addons extensions inline options page), do not activate // fast find. return false; } } return true; } } XPCOMUtils.defineLazyPreferenceGetter( FindBarChild, "findAsYouType", "accessibility.typeaheadfind" ); XPCOMUtils.defineLazyPreferenceGetter( FindBarChild, "manualFAYT", "accessibility.typeaheadfind.manual" ); PK