hi, i have problem creating my extension for Chrome Browser. my problem is like the following: when the tab is updating, and the tab has completed to load the url it alerts, but when the URL does not exists (404 error, and so on) it alerts twice, why does this happens? my code:
<html>
<head>
<script type="text/javascript">
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
updatedTab = tab;
updatedTabId = tabId;
updatedTabChangeInfo = changeInfo;
if (changeInfo.status == "complete")
{
if ((updatedTab.url.indexOf("http://") != -1 ||
updatedTab.url.indexOf("https://") != -1 ||
updatedTab.url.indexOf("ftp://") != -1)) // check that the current url isn't one of the options window and isnt one of chorme's basic pages
{
alert(updatedTab.url);
}
}
});
</script>
</head>
<body>
</body>
</html>
sorry for my bad english, thanks for the help