Mercurial > ambnews-firefox
comparison ambnews/content/ambnews.js @ 4:f4b6208eadd5
Increased delay to select URL bar text.
| author | Atul Varma <varmaa@toolness.com> |
|---|---|
| date | Thu, 21 Aug 2008 17:38:42 -0700 |
| parents | 2f424bef178f |
| children | 8cafc4c42c29 |
comparison
equal
deleted
inserted
replaced
| 3:2f424bef178f | 4:f4b6208eadd5 |
|---|---|
| 95 }, | 95 }, |
| 96 onLoad: function AmbNews_onLoad(aEvent) { | 96 onLoad: function AmbNews_onLoad(aEvent) { |
| 97 if (aEvent.target.baseURI == "about:blank") { | 97 if (aEvent.target.baseURI == "about:blank") { |
| 98 var doc = aEvent.target; | 98 var doc = aEvent.target; |
| 99 doc.defaultView.location = "about:news"; | 99 doc.defaultView.location = "about:news"; |
| 100 // TODO: The 10ms delay here *seems* to work all the time, | 100 // TODO: The delay here only works most of the time; |
| 101 // but its effectiveness could actually be a race condition. | 101 // its effectiveness is a race condition and we should |
| 102 window.setTimeout(function() { gURLBar.select(); }, 10); | 102 // figure out what even to listen for to actually select |
| 103 // the URL bar text consistently | |
| 104 window.setTimeout(function() { gURLBar.select(); }, 50); | |
| 103 } | 105 } |
| 104 } | 106 } |
| 105 }; | 107 }; |
