chrome.tabs.onUpdated.addListener( (function(first){ return function() { if(first)alert("123"); first = false; } })(true) );