您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
PubMed reddit ニコレポ ニコニコ静画 DuckDuckGo Pixiv Youtube Quora 音泉 Yahoo!ニュース ライブドアニュース Togetter gooニュース はてな匿名ダイアリー
当前为
// ==UserScript== // @name 「Show more」ボタンを自動で押す // @description PubMed reddit ニコレポ ニコニコ静画 DuckDuckGo Pixiv Youtube Quora 音泉 Yahoo!ニュース ライブドアニュース Togetter gooニュース はてな匿名ダイアリー // @version 0.1.4 // @match *://www.nicovideo.jp/my* // @match *://www.nicovideo.jp/user/* // @match *://seiga.nicovideo.jp/seiga/* // @match *://duckduckgo.com/* // @match *://www.pixiv.net/* // @match *://www.reddit.com/* // @match *://www.reddit.com/r/* // @match *://www.youtube.com // @match *://www.youtube.com/* // @match *://www.youtube.com/watch* // @match *://pubmed.ncbi.nlm.nih.gov/* // @match https://www.quora.com/* // @match https://www.onsen.ag/ // @match *://news.yahoo.co.jp/pickup* // @match https://news.livedoor.com/topics/detail/* // @match https://togetter.com/* // @match *://news.goo.ne.jp/* // @match *://anond.hatelabo.jp/* // @run-at document-idle // @grant GM_addStyle // @namespace http://greasyfork.icu/users/181558 // ==/UserScript== (function() { const moreButtonIntervalDefault = 1500; const siteinfo = [{ url: '//anond.hatelabo.jp/', moreButton: '//img[@class="icon" and @src="/images/common/open.gif"]/..', moreButtonInterval: 400, //GM_addStyle("div.section p{line-height:1}") }, { url: '//news.goo.ne.jp/', moreButton: '//a[@id="topics_1_more"]', }, { url: '//togetter.com/', moreButton: '//div/a[@id="more_tweet_btn"]', }, { url: '//news.livedoor.com/topics/detail/', moreButton: '//a[(text()="記事を読む")]', }, { // url: '//news.yahoo.co.jp/pickup', moreButton: '//div/p/a[text()="続きを読む"]', }, { // url: '//www.onsen.ag', moreButton: '//a[@class="load-more-btn"]', moreButtonSame: true, moreButtonInterval: 1000, }, { // url: '//pubmed.ncbi', moreButton: '//button[@class="load-button next-page"]', moreButtonSame: true, moreButtonInterval: 1000, /* }, { // reddit 常にBest順にしない版 url: '//www.reddit.com/r/', moreButton: '//font[contains(text(),"ディスカッション全体を表示")]|.//font[contains(text(),"ディスカッション全体を見る")]|.//button[contains(text(),"View entire discussion")]|.//button[contains(text(),"View Entire Discussion")]', moreButtonSame: false, moreButtonInterval: 500, */ }, { // reddit 常にBest順にする版 url: '//www.reddit.com/r/', moreButton: '//font[contains(text(),"ディスカッション全体を表示")]|.//font[contains(text(),"ディスカッション全体を見る")]|.//button[contains(text(),"View entire discussion")]|.//button[contains(text(),"View Entire Discussion")]|.//font[text()="ベスト"]|.//span[text()="best"]', moreButtonSame: false, moreButtonInterval: 500, /* }, { // サイトがダウン? url: '//www.ytplaylist.com', moreButton: '//li[@id="search-more-results"]/a', moreButtonInterval: 500, focusID: 'player' }, { // サイトがダウン? url: '//musictonic.com/music/', moreButton: '', focusID: 'player_container', optionFunc: 'musictonic' */ }, { // url: '//www.nicovideo.jp/my/top|//www.nicovideo.jp/user/|//www.nicovideo.jp/my', moreButton: '//div[@class="next-page"]/a|//a[@class="next-page-link timeline-next-link"]|//button[@class="NicorepoTimeline-more"]|//button[@class="ShowMoreList-more"]', moreButtonInterval: 1500, moreButtonSame: true, }, { // url: '//seiga.nicovideo.jp/seiga/', moreButton: '//a[@id="gif_play_button" and contains(text()," gifアニメを再生")]/span', moreButtonInterval: 500, }, { // url: '//duckduckgo.com/', moreButton: '//a[@class="result--more__btn btn btn--full"]', moreButtonInterval: 500, }, { // url: '//www.pixiv.net/', moreButton: '//div[text()="すべて見る"]/..', moreButtonInterval: 1000, }, { // url: '//www.quora.com/', moreButton: '//div[text()="Continue Reading"]|//font[text()="読み続けてください"]', moreButtonInterval: 200, }, { // url: '', moreButton: '', moreButtonInterval: '', focusID: '', focusInterval: '' }, { // url: '', // 対応させるページのURLの正規表現 matchすると有効 moreButton: '', // クリックさせる要素のXPath moreButtonSame: false, // trueなら同じボタンを何度でも押す falseなら1回のみ moreButtonInterval: '', // クリックする間隔(ms) 省略時はデフォルト(1500) focusID: 0, // trueならmoreButtonをfocusIntervalごとにfocusする focusInterval: '' // (focusIDが1のときのみ)moreButtonをfocusする間隔(ms) }, { // url: '//www.youtube.com', // moreButton: '//span[contains(text(),"続きを読む")]|//yt-formatted-string[contains(text(),"返信を表示")]|//span[contains(text()," さんの返信を表示")]|//span[contains(text()," 件を表示")]|//yt-formatted-string[text()="もっと見る"]|//paper-button[last()]/span[contains(text(),\"続きを読む\")]|//span/font[contains(text(),"続きを読む")]|//font[contains(text(),"返信を表示")]|//span/font[contains(text()," さんの返信を表示")]|//span/font[contains(text()," 件を表示")]|//span/font/font[contains(text(),"続きを読む")]|//yt-formatted-string/font[text()="もっと見る"]|//paper-button[@id="button" and @elevation="0" and @aria-label="検索フィルタ" and @aria-pressed="false"]/yt-icon', moreButton: '//paper-button[@id="button" and @elevation="0" and @aria-label="検索フィルタ" and @aria-pressed="false"]/yt-icon', moreButtonInterval: 1000, focusID: '', focusInterval: '', }]; var thissite = 0; for (var i = 0; i < siteinfo.length; i++) { if (siteinfo[i].url == "") continue; if (location.href.match(siteinfo[i].url)) { thissite = i; } } // console.log(thissite) if (siteinfo[thissite].moreButton) { //console.log("見つかりました"); setInterval(kurikku, siteinfo[thissite].moreButtonInterval ? siteinfo[thissite].moreButtonInterval : moreButtonIntervalDefault); } if (siteinfo[thissite].focusID) setInterval(focusid, siteinfo[thissite].focusInterval ? siteinfo[thissite].focusInterval : moreButtonIntervalDefault); // console.log(siteinfo[thissite]) /* if (location.href.match("musictonic")) { eleget0('//input[@id="q" and @name="q"]').value = eleget0('//h1[@class="artist"]').innerText.replace(/ Music Videos/, "") + " "; GM_addStyle("ul.videos li a { text-decoration: none; color: #999; }"); } */ return; function kurikku() { //console.log("押します") for (let ele of elegeta(siteinfo[thissite].moreButton)) { // console.log(isinscreen(ele) +" , "+ele.dataset.dataClickedAlready) if (isinscreen(ele) && ele.dataClickedAlready != true) { // 一度押した要素には.dataClickedAlreadyプロパティがついている ele.click(); if (siteinfo[thissite].moreButtonSame) {} else { ele.dataClickedAlready = true; // 一度押したら.dataClickedAlreadyプロパティをtrueにする // console.log(ele.outerHTML); break; } break; // 1度に一個しか押さない } } return; } function focusid() { if (document.activeElement != document.body && document.activeElement != null && /input|textarea/i.test(document.activeElement.tagName)) return; //入力フォームなら戻る if (window.getSelection() != "") return; //選択文字列があるなら戻る if (/BODY|A/i.test(document.activeElement.tagName)) { var ele = document.getElementById(siteinfo[thissite].focusID); if (ele) { ele.tabIndex = 0; ele.focus(); } } return; } function isinscreen(ele) { if (!ele) return; var eler = ele.getBoundingClientRect(); return (eler.top > 0 && eler.left > 0 && eler.left < document.documentElement.clientWidth && eler.top < Math.min(window.innerHeight, document.documentElement.clientHeight)); } function eleget0(xpath) { var ele = document.evaluate(xpath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); return ele.snapshotLength > 0 ? ele.snapshotItem(0) : ""; } function elegeta(xpath, node = document) { var ele = document.evaluate("." + xpath, node, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); var array = []; for (var i = 0; i < ele.snapshotLength; i++) array[i] = ele.snapshotItem(i); return array; } })();