AutoClickPagerize

just click more-load or next-page button

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         AutoClickPagerize
// @version      1
// @namespace    http://xxyyzz.net/
// @description  just click more-load or next-page button
// @author       kuma
// @match        http://*/*
// @match        https://*/*
// @grant        none
// ==/UserScript==

(function(){
  var SITEINFO=[
    {
      url:'^https?://jp\\.reuters\\.com/',
      nextElement:'//div[@class="more-load"]',
      exampleURL:'https://jp.reuters.com/theWire'
    },
    {
      url:'^https?://www3\\.nhk\\.or\\.jp/',
      nextElement:'//footer[@class="module--footer button-more"]/p',
      exampleURL:'https://www3.nhk.or.jp/news/catnew.html'
    },
    {
      url:'^https?://www\\.afpbb\\.com/',
      nextElement:'id("next-pager-latest")[not(@style="display: none;")]',
      exampleURL:'http://www.afpbb.com/list/latest'
    },
    {
      url:'^https?://dot\\.asahi\\.com/',
      nextElement:'id("js_foldedBtnReadmore")',
      exampleURL:'https://dot.asahi.com/dot/2018102400082.html'
    },
    {
      url:'^https?://duckduckgo\\.com/\\?q=',
      nextElement:'//a[@class="result--more__btn btn btn--full"]',
      exampleURL:'https://duckduckgo.com/?q=monkey&t=ffsb&ia=web'
    }
   ];
   function getInfo(){
     for (const info of SITEINFO) {
       if((new RegExp(info.url)).exec(document.URL))return info;
     }
    return false;
  }
  function getElementByXpath(path) {
    return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
  }
  var info=getInfo();
  if(!info)return;
  console.log("--- debug ---");
  var clickonce=true;
  var scroll= function() {
    var nextel=getElementByXpath(info.nextElement);
    if(!nextel)return;
    if(nextel.getBoundingClientRect().top-window.innerHeight+nextel.offsetHeight>-50)return;
    if(!clickonce)return;
    clickonce=false;
    nextel.click();
    setTimeout(function(){clickonce=true;}, 1000);
  }
  window.addEventListener("scroll", scroll, false);
  scroll();
})();