Skip to content

Instantly share code, notes, and snippets.

@egeste
Created March 5, 2020 22:14
Show Gist options
  • Save egeste/290b78158b7182cdcacf13b13dcff100 to your computer and use it in GitHub Desktop.
Save egeste/290b78158b7182cdcacf13b13dcff100 to your computer and use it in GitHub Desktop.
// Go to sumologic, open the chrome dev tools, paste this into the console, and run it (press enter).
// This script will cycle through all of your open dashboards in the current tab every 5 mins.
(function() {
let tabIndex = 0; // Start at index 0
const timeout = ((1000 * 60) * 5); // 5 min
setInterval(function () { // Start the timer
// Get whatever dashboard tabs are open at execution
const tabs = document.querySelectorAll('.tab-navigator__tab.tab-navigator__regular-tab._dashboard');
tabIndex++; // Increment the index
if (!tabs[tabIndex]) tabIndex = 0; // If there's no tab for this index, reset to the first index
if (!tabs[tabIndex]) return; // If there's no tab for the first index, do nothing.
const targetTab = tabs[tabIndex]; // Get a reference to the tab node
targetTab.click(); // Trigger a click event
}, timeout);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment