Re-apply shinigami css classes when they disappear due to Twitter/React mouseover
This commit is contained in:
parent
3ab9d38510
commit
960cc6d3a4
@ -87,6 +87,9 @@ function init() {
|
||||
setInterval(updateYouTubeChannelHeader, 300);
|
||||
setInterval(updateAllLabels, 6000);
|
||||
}
|
||||
if (hostname == 'twitter.com') {
|
||||
setInterval(updateTwitterClasses, 800);
|
||||
}
|
||||
|
||||
console.log('Self: ' + myself)
|
||||
|
||||
@ -126,6 +129,15 @@ var lastRightClickedElement: HTMLElement = null;
|
||||
var lastAppliedYouTubeUrl: string = null;
|
||||
var lastAppliedYouTubeTitle: string = null;
|
||||
|
||||
function updateTwitterClasses(){
|
||||
for (const a of document.querySelectorAll('a')) {
|
||||
if (a.assignedCssLabel && !a.classList.contains('has-assigned-label')) {
|
||||
a.classList.add('assigned-label-' + a.assignedCssLabel);
|
||||
a.classList.add('has-assigned-label');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateYouTubeChannelHeader() {
|
||||
var url = window.location.href;
|
||||
var title = document.getElementById('channel-title');
|
||||
|
Loading…
Reference in New Issue
Block a user