Skip to content

Instantly share code, notes, and snippets.

@ZeeCoder
Last active January 16, 2019 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZeeCoder/beecda9d476effb8fa76ca38e16022db to your computer and use it in GitHub Desktop.
Save ZeeCoder/beecda9d476effb8fa76ca38e16022db to your computer and use it in GitHub Desktop.
Facebook Dashboard Refresh
// Here You can type your custom JavaScript...
var onDashboard = location.href.indexOf('412279622274812/dashboard') !== -1;
if (onDashboard) {
var time = 10;
setTimeout(function() {
// scroll down to the graphs once the page loaded
var headerHeight = $('[data-click-area=biz_theme_header]').height() + $('[data-click-area=app_dash_header]').height()
var elementToScrollTo = document.querySelector('#developer_app_body > div > div:nth-child(2)');
window.scroll(0, elementToScrollTo.offsetTop - headerHeight);
// reload after a while
console.log('Refreshing page in ' + time + ' seconds');
setTimeout(function() {
location.reload();
}, time * 1000)
}, 10000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment