thanks .I got it.When the changeInfo.status == loading ,the changeInfo.url != undefined.
2010/1/4 Tase <taseh...@gmail.com> > ups... this code... > > var urlMap = []; > chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { > console.log(changeInfo.status,changeInfo.url); > if (changeInfo.status == "loading" && changeInfo.url != > "undefined"){ > urlMap[tabId] = true; > // the tab just changed url > } > else if (urlMap[tabId] && changeInfo.status == "complete"){ > urlMap[tabId] = false; > // the tab loaded the new url and changeInfo.url == > "undefined" > } > } > > On Jan 3, 6:58 pm, Tase <taseh...@gmail.com> wrote: > > > changeInfo.url is NOT null only when the url changes... so if the url > > > remains the same changeInfo.url is null > > > > try this code: > > > > chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { > > console.log(changeInfo.status,changeInfo.url); > > var urlMap = []; > > if (changeInfo.status == "loading" && changeInfo.url != > "undefined"){ > > urlMap[tabId] = true; > > // the tab just changed url > > } > > else if (urlMap[tabId] && changeInfo.status == "complete"){ > > urlMap[tabId] = false; > > // the tab loaded the new url and changeInfo.url == > > "undefined" > > } > > > > } > > > > On Jan 3, 6:45 pm, Tase <taseh...@gmail.com> wrote: > > > > > > > > > changeInfo.url is NOT null only when the url changes... so if the url > > > remains the same changeInfo.url is null > > > > > On Jan 3, 4:15 pm, im007boy <im007...@gmail.com> wrote: > > > > > > I have see the onUpdate event > > > > *chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) > {* > > > > * if (changeInfo.status == 'complete') {* > > > > * tabUrl = tab.url;* > > > > * tabTitle = tab.title;* > > > > * createLink();* > > > > *}* > > > > > > but when I debug,I found changeInfo only have one attribute > "status",how to > > > > use *changeInfo.url?Thank you.* > > > > -- > > > > ------ > > > > Chrome支持迅雷、快车、旋风专用链插件 > http://code.google.com/p/mychrome/wiki/PrivateLinksSupport > > -- > > You received this message because you are subscribed to the Google Groups > "Chromium-extensions" group. > To post to this group, send email to chromium-extensi...@googlegroups.com. > To unsubscribe from this group, send email to > chromium-extensions+unsubscr...@googlegroups.com<chromium-extensions%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/chromium-extensions?hl=en. > > > -- ------ Chrome支持迅雷、快车、旋风专用链插件 http://code.google.com/p/mychrome/wiki/PrivateLinksSupport -- You received this message because you are subscribed to the Google Groups "Chromium-extensions" group. To post to this group, send email to chromium-extensi...@googlegroups.com. To unsubscribe from this group, send email to chromium-extensions+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/chromium-extensions?hl=en.