Here is my code:
function checkUrlPattern(tab)
{
alert(tab.url);
}
// Listen for any changes to the URL of any tab.
chrome.tabs.onUpdated.addListener(checkUrlPattern);
chrome.tabs.onCreated.addListener(checkUrlPattern);
when a new tab was created, in CheckUrlPattern the tab.url's value is
empty.
but when the onUpdated event was fired, the tab.url has its value.
but here is some similar code in the page
http://code.google.com/chrome/extensions/events.html,
chrome.tabs.onCreated.addListener(function(tab) {
appendToLog('tabs.onCreated --'
+ ' window: ' + tab.windowId
+ ' tab: ' +
tab.id
+ ' index: ' + tab.index
+ ' url: ' + tab.url);
});
So I think, the tab'url should has its value when the new tab created.
Another question is "where the log files which contain the log content
written by appendToLog ?"
Thanks for help.