Last active
August 27, 2022 16:11
-
-
Save cyatarow/df504a14b9b79462dc28c0bda590f0a7 to your computer and use it in GitHub Desktop.
マイネ王 ユーザーコメントブロッカーUserScript(仮)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name マイネ王 ユーザーコメントブロッカー(UserScript) | |
// @namespace Violentmonkey Scripts | |
// @match *://king.mineo.jp/reports/* | |
// @grant none | |
// @version 0001 | |
// @author - | |
// @description 2022/8/26 22:09:25 | |
// ==/UserScript== | |
let comments = document.querySelectorAll('.media.mb-2 .media-left.align-self-center.mr-2 a'); | |
//alert(comments.length); | |
let target; | |
let blockList = [ | |
'https://king.mineo.jp/my/12345example', | |
'https://king.mineo.jp/my/67890example', | |
'https://king.mineo.jp/my/xxxxxyyyyyzzzzzexample' | |
]; | |
//↑のblockList配列に、上記の表記例を参考にしてブロックしたいユーザーのマイページURLを追加していってください | |
//・各URLはシングルクォーテーションで囲むこと | |
//・シングルクォーテーションの後にコンマを置くこと(ただし一番下のURLにはコンマを置かないでください) | |
for(let i=0; i<comments.length; i++){ | |
for(let listNum=0; listNum<blockList.length; listNum++){ | |
if(comments[i].href == blockList[listNum]){ | |
target = comments[i].closest(".my-4").querySelector('.rounded-lg.py-2.pb-3.px-3.mb-2.readable.balloon.break-word.bg-balloon div'); | |
target.style = 'color: #f66'; | |
target.textContent = '<このユーザーはブロック対象です>'; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment