javascript - Change title on the tooltip of browser action in a chrome extension app -
i trying alter title on tooltip whenever brwoser action clicked. in case tool tip says "proud moment". want alter "hi". please @ code in background.js
these resources of extension app:
manifest.json
{ "name" : "test", "description" : "positive results", "version" : "2.0", "manifest_version" : 2, "permissions": [ "activetab" ], "browser_action" : { "default_title" : "proud moment", "default_popup" : "popup.html" }, "background": { "scripts": [ "background.js" ], "persistent": false } }
background.js
chrome.browseraction.onclicked.addlistener( function(tab){ chrome.browseraction.settitle({title :"hi"}); });
popup.html
<html> <body> <p> evrything goes here !!</p> </body> </html>
you cannot have both browser action click event callback , popup.
from https://developer.chrome.com/extensions/browseraction#event-onclicked
onclicked
fired when browser action icon clicked. this event not fire if browser action has popup.
maybe send message popup background.js
alter browser action title when popup opens.
javascript google-chrome-extension
No comments:
Post a Comment