Greasemonkey

I’m late to the game as Greasemonkey has been around for quite a while. But today I decided to write my own script. I’m using the Neutronium GTK themeand bugzilla.redhat.com had white text on yellow buttons. So I wrote a script to change the colors. It’s not very pretty but it works for me.

// ==UserScript==
// @name            Bugzilla Style
// @namespace       https://zeusville.wordpress.com
// @description     Changes the color of the yellow buttons
// @include         https://bugzilla.redhat.com/*
// @include         http://bugzilla.redhat.com/*
// ==/UserScript==

var element;
var inputs = document.getElementsByTagName('input');
for (var i = 0; i < inputs.length; i++) {
    element = inputs[i];
    if (element.type == 'text' || element.type == 'checkbox' ||
        element.type == 'radio') {

        element.style.background = "#141414";
    }
    else if (element.type == 'submit') {
        element.style.background = "#313131";
    }
}

var elements = document.getElementsByTagName('select');
for (var i = 0; i < elements.length; i++) {
    element = elements[i];
    element.style.background = "#141414";
}

elements = document.getElementsByTagName('textarea');
for (var i = 0; i < elements.length; i++) {
    element = elements[i];
    element.style.background = "#141414";
}
About these ads

One response to “Greasemonkey

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s