I am trying to make a new Chrome extension, and I need the icon to automatically change like a gif with an array of images, and repeat forever. My problem is I can't get the Javascript loop to work. Here is what I've got:
var min = 1;
var max = 12;
var current = min;
if (current > max)
current = min;
}
var keep_switching_icon = true;
function rotateIcon()
{
if ( keep_switching_icon )
{
chrome.browserAction.setIcon({path:"icon" + current + ".png"});
current++;
window.setTimeout(rotateIcon, 300);
}
}