-
Notifications
You must be signed in to change notification settings - Fork 124
/
Copy pathaddHistoryToTextboxOfFindNode.uc.js
52 lines (47 loc) · 1.66 KB
/
addHistoryToTextboxOfFindNode.uc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// ==UserScript==
// @name addHistoryToTextboxOfFindNode.uc.js
// @namespace http://space.geocities.yahoo.co.jp/gl/alice0775
// @description add history dropdown on FindNode dialog of DOMi
// @include chrome://inspector/content/viewers/dom/findDialog.xul
// @compatibility Firefox 3.0 more
// @author Alice0775
// @version 2009/09/26 13:00
// @version 2009/09/25 23:55
// @Note
// ==/UserScript==
var addHistoryToTextboxOfFindNode = {
textbox: null,
init: function(){
var textbox = document.getElementById("tfText1");
if (!textbox)
return;
var value = textbox.value;
var height = textbox.boxObject.height;
textbox.setAttribute("type", "autocomplete");
textbox.setAttribute("autocompletesearch", "form-history");
textbox.setAttribute("autocompletesearchparam", "findNode-history");
textbox.setAttribute("enablehistory", "true");
textbox.height = height;
this.textbox = textbox;
dialog.__doFind = dialog.doFind;
dialog.doFind = function() {
addHistoryToTextboxOfFindNode.addHindNodeHistory();
dialog.__doFind();
}
setTimeout(function(textbox, value){
textbox.value = value;
textbox.select();
},100, textbox, value);
},
addHindNodeHistory: function (){
var textbox = this.textbox;
var aSearchString = textbox.value;
if(aSearchString.replace(/ /g,'')!==''){
var formHistory;
formHistory = Components.classes["@mozilla.org/satchel/form-history;1"]
.getService(Components.interfaces.nsIFormHistory2);
formHistory.addEntry("findNode-history", aSearchString);
}
}
}
addHistoryToTextboxOfFindNode.init();