I'm writing a chrome extension page action that works on certain URLs, more I realized that the URL specifies the icon shows in situations like this www.google.com/urlespecifies, I want the icon to appear only when the User is within the site.
My background file is thus
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
if (~tab.url.indexOf('urlespecifies.com')) {
chrome.pageAction.show(tabId);
}
});
my manifest
{
"name": "Compra Protegida",
"version": "1.6",
"description": "Alerta usuários ao acessar sites de compras virtuais não recomendado pelo Reclame Aqui ou presentes na Lista do Procon. ",
"background" : {
"scripts" : [ "background.js" ]
} ,
"page_action": {
"default_icon": "19.png",
"default_title":"Site não recomendado",
"default_popup":"popup.html"
},
"permissions" : [
"tabs"
],
"icons" : {
"48" : "48.png",
"128" : "128.png"
},
"manifest_version": 2
}Hey, I'm not sure if I unterstand you completly but you should also check the activated tab with chrome.tabs.onActivated
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/32ab02ce-2b38-4c9e-8320-357ed1aafb66%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.