--- a/browser/components/preferences/in-content/findInPage.js
+++ b/browser/components/preferences/in-content/findInPage.js
@@ -39,18 +39,27 @@ var gSearchResultsPane = {
if (event.type === "command" ||
(event.type === "keypress" && event.keyCode === 13)) {
this.searchFunction(event);
} else if (event.type === "focus") {
this.initializeCategories();
} else if (event.type === "input") {
console.log("input",event,event.keyCode)
let query = event.target.value.trim()
- console.log("Search Suggestions: ",this.trie.autoComplete(String(query.toLowerCase())));
- this.searchSuggestions(this.trie.autoComplete(String(query.toLowerCase())));
+ //console.log("Search Suggestions: ",this.trie.autoComplete(String(query.toLowerCase())));
+ //this.searchSuggestions(this.trie.autoComplete(String(query.toLowerCase())));
+ let xxx = [ "app","cat", "hahaha", "soup", "okay","apple","start", "startup", "starts", "stable",
+ "store", "save", "switch", "alternate", "allow", "allowed", "accept", "accessibility", "acceleration",
+ "account","tab", "tabs", "track", "thirdparty", "text", "terms", "typing", "type", "time","babay","happy",
+ "dance", "ok", "look","app","cat", "hahaha", "soup", "okay","apple","start", "startup", "starts", "stable",
+ "store", "save", "switch", "alternate", "allow", "allowed", "accept", "accessibility", "acceleration",
+ "account","tab", "tabs", "track", "thirdparty", "text", "terms", "typing", "type", "time","babay","happy",
+ "dance", "ok", "look"];
+ this.searchSuggestions(xxx);
+
} else if (event.type === "keypress"){
if (this.timer != null) {
//console.log("cancel");
this.timer.disarm();
}
this.timer = new DeferredTask(function* () {
//console.log("searching DeferredTask");
gSearchResultsPane.searchFunction(event);
@@ -247,48 +256,59 @@ var gSearchResultsPane = {
}
for (let word of listSuggestions){
let option = document.createElementNS('http://www.w3.org/1999/xhtml', 'option');
option.setAttribute("value",word);
option.setAttribute("data-value",word);
//option.setAttribute("xmlns" ,"http://www.w3.org/1999/xhtml");
object.appendChild(option);
}
- var keyboardEvent = document.createEvent("KeyboardEvent");
- var initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? "initKeyboardEvent" : "initKeyEvent";
+ // var keyboardEvent = document.createEvent("KeyboardEvent");
+ // var initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? "initKeyboardEvent" : "initKeyEvent";
- keyboardEvent[initMethod](
- "keyup", // event type : keydown, keyup, keypress
- true, // bubbles
- true, // cancelable
- window, // viewArg: should be window
- false, // ctrlKeyArg
- false, // altKeyArg
- false, // shiftKeyArg
- false, // metaKeyArg
- 40, // keyCodeArg : unsigned long the virtual key code, else 0
- 0 // charCodeArgs : unsigned long the Unicode character associated with the depressed key, else 0
- );
- this.searchInput.focus();
- this.searchInput.dispatchEvent(keyboardEvent);
- // //object.focus();
+ // keyboardEvent[initMethod](
+ // "keypress", // event type : keydown, keyup, keypress
+ // true, // bubbles
+ // true, // cancelable
+ // window, // viewArg: should be window
+ // false, // ctrlKeyArg
+ // false, // altKeyArg
+ // false, // shiftKeyArg
+ // false, // metaKeyArg
+ // 40, // keyCodeArg : unsigned long the virtual key code, else 0
+ // 0 // charCodeArgs : unsigned long the Unicode character associated with the depressed key, else 0
+ // );
// this.searchInput.focus();
- let DblDelay = new DeferredTask(() => {
- var event = new MouseEvent('dlbclick', {
- 'view': window,
- 'bubbles': true,
- 'cancelable': true
- });
- document.getElementById("browserHomePage").focus();
- gSearchResultsPane.searchInput.focus();
- gSearchResultsPane.searchInput.dispatchEvent(event);
- console.log("click")
- }, 1000);
- DblDelay.arm();
+ // this.searchInput.dispatchEvent(keyboardEvent);
+ // // //object.focus();
+ // // this.searchInput.focus();
+ // let DblDelay = new DeferredTask(() => {
+ // var event = new MouseEvent('click', {
+ // 'view': window,
+ // 'bubbles': true,
+ // 'cancelable': true
+ // });
+ // document.getElementById("browserHomePage").focus();
+ // gSearchResultsPane.searchInput.focus();
+ // gSearchResultsPane.searchInput.dispatchEvent(event);
+ // console.log("click")
+ // }, 450);
+ // DblDelay.arm();
+ // let DblDelay2 = new DeferredTask(() => {
+ // var event = new MouseEvent('click', {
+ // 'view': window,
+ // 'bubbles': true,
+ // 'cancelable': true
+ // });
+ // gSearchResultsPane.searchInput.dispatchEvent(event);
+ // console.log("click")
+ // }, 550);
+ // DblDelay2.arm();
+
},
/**
* Shows or hides content according to search input
*
* @param String event
* to search for filted query in
*/