您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
ニコニコ動画の検索フィルタの投稿日時の期間に3ヶ月と1年の選択肢を追加します。
// ==UserScript== // @name ニコニコ動画の検索フィルタの投稿日時の期間の選択肢を増やす // @namespace rinsuki.net // @match https://www.nicovideo.jp/search/* // @match https://www.nicovideo.jp/tag/* // @grant none // @version 1.1 // @author - // @description ニコニコ動画の検索フィルタの投稿日時の期間に3ヶ月と1年の選択肢を追加します。 // ==/UserScript== (() => { const choices = document.querySelector(".searchOption .filterOptionContainer .postTime ul") const customChoice = choices.children[choices.children.length-1] function dateToNicoString(date) { return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, "0")}-${date.getDate().toString().padStart("0", 2)}` } const hr = document.createElement("li") hr.style = "border-top: 1px solid #999"; choices.insertBefore(hr, customChoice) function add(name, days) { const date = new Date(Date.now() - (days * 24 * 60 * 60 * 1000)) const li = choices.querySelector("li:not(.active)").cloneNode(true) li.classList.remove("active") const link = li.children[0] link.innerText = name link.href = link.href.replace(/f_range=\d/, "") link.href += `&start=${dateToNicoString(date)}` link.href += `&end=${dateToNicoString(new Date())}` choices.insertBefore(li, customChoice) } add("3ヶ月以内", 90) add("1年以内", 365) })()