Develop #14

Closed
Serraniel wants to merge 19 commits from develop into master
2 changed files with 8 additions and 4 deletions
Showing only changes of commit ce23bd835a - Show all commits

View file

@ -5,7 +5,7 @@ registerScript(node => {
changeBorderColor(node); changeBorderColor(node);
removeUnknownUsers(node); removeUnknownUsers(node);
} }
}); }, "/requests");
function changeFollowedStarColor(node) { function changeFollowedStarColor(node) {
const starIcon = 'star'; const starIcon = 'star';

View file

@ -1,11 +1,15 @@
let __scripts = []; let __scripts = [];
function registerScript(func) { function registerScript(func, pattern = '.*') {
__scripts.push(func); __scripts.push({ "function": func, "pattern": pattern });
} }
function runScripts(node) { function runScripts(node) {
__scripts.forEach(script => script(node)); __scripts.forEach(script => {
if (window.location.pathname.match(script.pattern)) {
script.function(node);
}
});
} }
let observer = new MutationObserver(mutations => { let observer = new MutationObserver(mutations => {