Skip to content

Instantly share code, notes, and snippets.

Created May 31, 2017 20:13
  • Star 20 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Automatic scroll of Instagram page, stop scrolling by hand...
Tired of scrolling to one of the last photos on the page on Instagram? Let your
browser do the scrolling for you!
(c) 2017 - Loran Kloeze -
- Go to (change instagram_handle in i.e. taylorswift)
- Open up the console (F12) (Firefox users: type 'allow pasting' if you haven't done so yet)
- Select the contents of this complete file and copy/paste it to the console and hit enter
- You may close the console now
- A UI pops up at the left, click on the button to start scrolling
- If you scroll with the mouse, the autoscroll stops
(function() {
'use strict';
var weAreScrolling = false;
var scrollTimer = null, btnToggle = null;
var instaFooter = document.querySelector('footer');
function startScrolling(){
weAreScrolling = true;
btnToggle.innerHTML = 'Stop autoscroll';
scrollTimer = window.setInterval(
function () {
}, 10);
function stopScrolling(){
weAreScrolling = false;
if (btnToggle) {
btnToggle.innerHTML = 'Start autoscroll';
if (scrollTimer)
// Little UI overlay
var style = "";
style += "#lokl_guiContainer {position: fixed; width: 100px; height: 100px; top: 5px; left: 5px; background-color: rgba(255, 193, 7, 0.31); padding: 15px;";
style += " font-family: -apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif; font-size: 14px; font-weight: 600; border: solid 1px rgb(255, 193, 7); border-radius: 3px;} ";
style += "#lokl_toggleScroll {padding: 5px 2px; border-radius: 3px; text-align: center; background-color: #35b13d; color: white;}";
style += "#lokl_toggleScroll:hover {background-color: #2e9835; cursor: pointer;}";
style += " {background-color: #bb3a30; }";
style += " {background-color: #a9342b; }";
var styleEl = document.createElement("style");
styleEl.innerHTML = style;
var guiContainer = document.createElement('div');
document.body.append(guiContainer); = 'lokl_guiContainer';
btnToggle = document.createElement('a');
guiContainer.append(btnToggle); = 'lokl_toggleScroll';
btnToggle.innerHTML = 'Start autoscroll';
window.addEventListener('wheel', function(e) {
// User starts scrolling, we stop
btnToggle.addEventListener('click', function(){
if (weAreScrolling) {
} else {
// Fake click on 'Load more' or we can't scroll at all
document.querySelector('#react-root > section > main > article > div > a').click();
Copy link

Thanks for the script. How do I make it work for just instagram followers.
That is
Go to
Click on 67.3k followers
And the script keeps scrolling till the end by clicking on start autoscroll.

Copy link

GreatMaster commented Aug 17, 2018

it does not work in chrome :(

Copy link

That's not a lot of information to go on. Please post some error messages.

Copy link

T21yx64 commented Nov 3, 2018

First of all Developer, this is a great script, beautifully written, works wonderfully on Firefox.
Now I wanted you to add on to this script.
by considering this script
could you please work on this to combine the two scripts & make an automatic feed post liking script.
thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment