开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜