Last active
January 16, 2019 15:10
-
-
Save ZeeCoder/beecda9d476effb8fa76ca38e16022db to your computer and use it in GitHub Desktop.
Facebook Dashboard Refresh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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