Google Chrome Extension Running JavaScript on Load
I would like run chrome.browserAction.setBadgeText method when my popup extension loads. When I put this code on the global scope, it works only when I click on the extension button. But I would like to see the badge when Google Chrome starts. What is the method I am looking for开发者_运维问答?
Thanks
You'll want to create a background page, which can load any JavaScript you want. The background page is loaded as the browser opens, so it should be fairly trivial to make your code run at load time.
精彩评论