CSC Autoscroll

Automatically scroll on cocksizecontest main page

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        CSC Autoscroll
// @description Automatically scroll on cocksizecontest main page
// @namespace   cocksizecontest.com
// @include     https://www.cocksizecontest.com/
// @include     https://www.cocksizecontest.com/#*
// @version     1
// @grant       none
// ==/UserScript==

var autoscrollTimeout = null;

window.addEventListener('scroll', function() {
  if (autoscrollTimeout) {
    clearTimeout(autoscrollTimeout);
  }
  autoscrollTimeout = window.setTimeout(function() {

    // window.scrollTop + window.innerHeight == lowest pixel viewable
    // subtract document.height to get how much is left below the page
    //console.log("scrollTop: " + window.scrollY);
    //console.log("innerHeight: " + window.innerHeight);
    //console.log("height: " + document.body.scrollHeight);
    if (document.body.scrollHeight < 500) {
      return;
    }
    var remaining = document.body.scrollHeight - (window.scrollY + window.innerHeight);
    if (remaining < 500) {
      var link = document.querySelector('.cscMoreFeedLink > a[href]');
      if (link) {
        link.click();
      }
    }
    
  }, 300);
});