Use hideCommentOrDimComment feature
This commit is contained in:
parent
befe757f90
commit
f92c7e8519
16
ytch.user.js
16
ytch.user.js
@ -3,7 +3,7 @@
|
|||||||
// @namespace https://austenwares.com/gogs/stonewareslord/ytch
|
// @namespace https://austenwares.com/gogs/stonewareslord/ytch
|
||||||
// @description Hides youtube comments that contain specified text
|
// @description Hides youtube comments that contain specified text
|
||||||
// @author stonewareslord
|
// @author stonewareslord
|
||||||
// @version 0.1
|
// @version 0.1.1
|
||||||
// @homepage https://austenwares.com/gogs/stonewareslord/ytch
|
// @homepage https://austenwares.com/gogs/stonewareslord/ytch
|
||||||
// @include http://youtube.com/watch*
|
// @include http://youtube.com/watch*
|
||||||
// @include https://youtube.com/watch*
|
// @include https://youtube.com/watch*
|
||||||
@ -11,7 +11,6 @@
|
|||||||
// @include https://www.youtube.com/watch*
|
// @include https://www.youtube.com/watch*
|
||||||
// @run-at document-body
|
// @run-at document-body
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
// Options
|
// Options
|
||||||
// Set this to 'hide' to hide comments that contain words
|
// Set this to 'hide' to hide comments that contain words
|
||||||
// Set this to 'dim' to dim comments that contain words
|
// Set this to 'dim' to dim comments that contain words
|
||||||
@ -31,10 +30,15 @@ function clearComments(){
|
|||||||
for (var j = 0; j < wordList.length; j++) {
|
for (var j = 0; j < wordList.length; j++) {
|
||||||
if (comments[i].textContent.includes(wordList[j])) {
|
if (comments[i].textContent.includes(wordList[j])) {
|
||||||
commentToRemove=comments[i].parentNode.parentNode.parentNode;//.parentNode;
|
commentToRemove=comments[i].parentNode.parentNode.parentNode;//.parentNode;
|
||||||
// Set the opacity to 40%
|
if(hideCommentOrDimComment == 'hide'){
|
||||||
commentToRemove.style.opacity=.4;
|
// They want to hide, remove the comment
|
||||||
// Remove the comment chain entirely
|
commentToRemove.parentNode.removeChild(commentToRemove);
|
||||||
//commentToRemove.parentNode.removeChild(commentToRemove);
|
} else if(hideCommentOrDimComment == 'dim'){
|
||||||
|
// They want to dim, set the opacity to 40%
|
||||||
|
commentToRemove.style.opacity = 0.4;
|
||||||
|
} else {
|
||||||
|
// hideCommentOrDimComment is improperly set, do nothing
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user