In my Chrome Extension, I want that when the URL is reloaded then an alert box will appear, but it does not work
Here is the manifest:
{
"manifest_version": 2,
"name": "Sample Extension",
"description": "Sample Chrome Extension",
"version": "1.0",
"background": {
"scripts": ["background.js"]
},
"browser_action": {
"default_icon": "icon.png",
"default_title": "That's extension",
"default_popup": "popup.html"
},
"permissions":[
"http://translate.google.hu/*", "tabs"
]
}
background.js
:
chrome.tabs.onUpdated.addListener(function(tabId,changeInfo,tab) {
if (tab.url.indexOf("http://translate.google.hu/") > -1 &&
changeInfo.url == "undefined") {
window.alert('test')
}
});