south+vimium

vimium 翻页

2021-08-07 기준 버전입니다. 최신 버전을 확인하세요.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

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

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         south+vimium
// @namespace    https://greasyfork.org/zh-CN/scripts/382722-page
// @version      0.11
// @description  vimium 翻页
// @author       ayase
// @match        https://*.summer-plus.net/*
// @match        https://*.level-plus.net/*
// @match        https://*.white-plus.net/*
// @match        https://*.south-plus.net/*
// @match        https://*.imoutolove.me/*
// @match        https://summer-plus.net/*
// @match        https://level-plus.net/*
// @match        https://white-plus.net/*
// @match        https://south-plus.net/*
// @match        https://imoutolove.me/*
// @grant        none
// ==/UserScript==

(() => {

  const main = () => {
    const currPage = parseInt(document.querySelector('.pages b').textContent, 10)
    const prePage = (currPage === 1) ? 1 : (currPage - 1)
    const nextPage = currPage + 1
    for (const node of queryTextAll('.pages a', '»')) {
      const href = node.getAttribute('href')
      node.setAttribute('href', href.replace(/page-\d+/i, `page-${nextPage}`))
    }

    for (const node of queryTextAll('.pages a', '«')) {
      const href = node.getAttribute('href')
      node.setAttribute('href', href.replace(/page-\d+/i, `page-${prePage}`))
    }
  }

  /**
   * 选择所有包含指定字符串的节点
   * @param {string} selector 
   * @param {string} text 
   */
  const queryTextAll = (selector, text) => {
    const r = []
    for (const node of Array.from(document.querySelectorAll(selector))) {
      if (node.textContent.includes(text)){
        r.push(node)
      }
    }
    return r
  }

  main()
  

})()