comparison ambnews/content/ambnews.js @ 3:2f424bef178f

The 'about:news' text in the url bar is selected whenever a new tab is opened, so that just creating a new tab and typing stuff always does what it used to do (habituation isn't broken).
author Atul Varma <varmaa@toolness.com>
date Thu, 21 Aug 2008 17:29:51 -0700
parents 88b12596346d
children f4b6208eadd5
comparison
equal deleted inserted replaced
2:88b12596346d 3:2f424bef178f
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,
101 // but its effectiveness could actually be a race condition.
102 window.setTimeout(function() { gURLBar.select(); }, 10);
100 } 103 }
101 } 104 }
102 }; 105 };