Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @match http://hakugyokuro.go-board.com/*
- // ==/UserScript==
- function getRandomColor() {
- var letters = '0123456789ABCDEF'.split('');
- var color = '#';
- for (var i = 0; i < 6; i++ ) {
- color += letters[Math.floor(Math.random() * 16)];
- }
- return color;
- }
- function changeColors() {
- chatFrame = document.getElementById("frame_chatbox");
- var anchors;
- if(chatFrame == null)
- anchors = document.getElementsByTagName("a");
- else
- anchors = chatFrame.contentDocument.getElementsByTagName("a");
- var color = getRandomColor();
- for(i = 0; i < anchors.length; i++) {
- ref = anchors[i].getAttribute("href");
- if(ref == null)
- ref = anchors[i].getAttribute("HREF");
- if(ref != null) {
- user = (ref.search("/u") >= 0);
- if(user) {
- span = anchors[i].getElementsByTagName("span")[0];
- if(span != null)
- span.style.color = getRandomColor();
- }
- }
- }
- }
- setInterval(function() {changeColors();}, 500);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement