Skip to content

Instantly share code, notes, and snippets.

@serby
Last active December 17, 2015 12:39
Show Gist options
  • Select an option

  • Save serby/5611617 to your computer and use it in GitHub Desktop.

Select an option

Save serby/5611617 to your computer and use it in GitHub Desktop.
Cycle all tabs in chrome for 1 minute.
var i = 0;
if (typeof cycleInt !== 'undefined') clearInterval(cycleInt);
function interval() {
chrome.tabs.getAllInWindow(onAllTabs)
}
function onAllTabs(tabs) {
if (i >= tabs.length) i = 0;
chrome.tabs.update(tabs[i++].id, { active: true })
}
cycleInt = setInterval(interval, 60000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment