Skip to content

Instantly share code, notes, and snippets.

@daveio daveio/autorefresh.js
Last active Sep 13, 2018

Embed
What would you like to do?
Auto-refresh for Twitter Web
/* Enable commented lines (beneath this documentation) if you want to use in a userscript or similar,
otherwise copy all uncommented lines (or the whole gist) and paste into the javascript console.
Note that the update will only happen if you're scrolled all the way to the top. This prevents the
page jumping around when the update happens.
If you're pasting into the Javascript console, bear in mind that if you refresh with your browser,
the functionality will be lost and you'll need to paste it in again.
MIT licenced
Dave Williams (github:daveio), September 2018 */
// $(document).ready(function () {
var refresher = setInterval( function () {
if ($(document).scrollTop() < 1) {
if ($('button.new-tweets-bar').css('visibility') != undefined) {
$('button.new-tweets-bar').click();
}
}
}, 100);
// $.refresher = refresher;
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.