change icon dynamically chrome extension developer code example

Example 1: change icon dynamically chrome extension developer

chrome.browserAction.setIcon({imageData:canvasContext.getImageData(0, 0, canvas.width,canvas.height)});

Example 2: change icon dynamically chrome extension developer

chrome.browserAction.setBadgeBackgroundColor({color:[190, 190, 190, 230]});
chrome.browserAction.setBadgeText({text:"?"});

Example 3: change icon dynamically chrome extension developer

chrome.browserAction.setIcon({path: icon});

Tags:

Misc Example