Fixed other Monstercat messages overwriting stuff

This commit is contained in:
Norbi Peti 2016-06-10 17:59:32 +02:00 committed by GitHub
parent a61447c64f
commit c780cb1da9

View file

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name MonsterLyrics button // @name MonsterLyrics button
// @namespace https://github.com/NorbiPeti/ // @namespace https://github.com/NorbiPeti/
// @version 0.7 // @version 0.8
// @description Creates a button that searches for a lyrics video! // @description Creates a button that searches for a lyrics video!
// @author NorbiPeti // @author NorbiPeti
// @match https://www.youtube.com/* // @match https://www.youtube.com/*
@ -74,7 +74,10 @@ function AddTwitch() {
{ {
if(typeof namecontTwitch[i] != 'undefined' && namecontTwitch[i].getElementsByClassName("from")[0].innerHTML=="Monstercat") if(typeof namecontTwitch[i] != 'undefined' && namecontTwitch[i].getElementsByClassName("from")[0].innerHTML=="Monstercat")
{ {
twitchmsg=namecontTwitch[i].getElementsByClassName("message")[0]; var msg=namecontTwitch[i].getElementsByClassName("message")[0];
if(msg.innerHTML.indexOf("Now Playing: ")==-1)
continue;
twitchmsg=msg;
break; break;
} }
} }