OLD | NEW |
1 <html> | 1 <html> |
2 <body> | 2 <body> |
3 <h1>Instant</h1> | 3 <h1>Instant</h1> |
4 <div id=log></div> | 4 <div id=log></div> |
5 <script> | 5 <script> |
6 window.chrome.sv = true; | 6 window.chrome.sv = true; |
7 | 7 |
8 window.onsubmitcalls = 0; | 8 window.onsubmitcalls = 0; |
9 window.onchangecalls = 0; | 9 window.onchangecalls = 0; |
10 window.oncancelcalls = 0; | 10 window.oncancelcalls = 0; |
11 window.onresizecalls = 0; | 11 window.onresizecalls = 0; |
12 | 12 |
13 var searchBox = window.chrome.searchBox || {}; | 13 var searchBox = window.chrome.searchBox || {}; |
14 | 14 |
15 window.beforeLoadSearchBox = {}; | 15 window.beforeLoadSearchBox = {}; |
16 for (var prop in searchBox) window.beforeLoadSearchBox[prop] = searchBox[prop]; | 16 for (var prop in searchBox) window.beforeLoadSearchBox[prop] = searchBox[prop]; |
17 | 17 |
| 18 window.setSuggestionsArgument = { |
| 19 suggestions: [ |
| 20 { value: "abcdef" } |
| 21 ] |
| 22 }; |
| 23 |
18 window.chrome.searchBox.onsubmit = function() { | 24 window.chrome.searchBox.onsubmit = function() { |
19 searchBox.setSuggestions(["abcdef"]); | 25 searchBox.setSuggestions(setSuggestionsArgument); |
20 window.onsubmitcalls++; | 26 window.onsubmitcalls++; |
21 }; | 27 }; |
22 | 28 |
23 window.chrome.searchBox.onchange = function() { | 29 window.chrome.searchBox.onchange = function() { |
24 searchBox.setSuggestions(["abcdef"]); | 30 searchBox.setSuggestions(setSuggestionsArgument); |
25 window.onchangecalls++; | 31 window.onchangecalls++; |
26 }; | 32 }; |
27 | 33 |
28 window.chrome.searchBox.oncancel = function() { | 34 window.chrome.searchBox.oncancel = function() { |
29 searchBox.setSuggestions(["abcdef"]); | 35 searchBox.setSuggestions(setSuggestionsArgument); |
30 window.oncancelcalls++; | 36 window.oncancelcalls++; |
31 }; | 37 }; |
32 | 38 |
33 window.chrome.searchBox.onresize = function() { | 39 window.chrome.searchBox.onresize = function() { |
34 window.onresizecalls++; | 40 window.onresizecalls++; |
35 }; | 41 }; |
36 </script> | 42 </script> |
37 </body> | 43 </body> |
38 </html> | 44 </html> |
OLD | NEW |