Modifying Howrse with Greasemonkey

I use Adblock Plus which blocks all the ads which is great.  The issue on Howrse then becomes the 2 pixel wide border around the ad that doesn’t get blocked because it’s part of the HTML.  I could use the add-on to block the element the ad is in, but that messes up how the page displays because the background on the horse’s page is positioned so the horse is slightly below the center of the background by default when the horse’s page is in reduced landscape mode.  So I looked into using Greasemonkey to create a script to either move it or remove the border of the banner ad.  I’ve been able to both move the banner ad and remove the border for the banner ad.   Moving the banner ad requires modifying the named <div> tag (“banner”) the banner ad was displayed in to push the banner ad far enough off to the right you couldn’t see it.  This does, however, put a scroll bar on the bottom of the page due to the page width being increased, but there isn’t an unsightly empty border sitting in the middle of the page anymore.  Removing the banner ad’s border requires finding the div that has the border and setting the border to 0px wide.  The problem I had initially in doing this was I was searching for the tag that had the code the style-sheet used when I should have been lo0king for the style the browser was using since it converted the RGB color code to hex.  All in all, I call this a Win!

The script, as far as I know, only works on Firefox with the Greasemonkey add-on.  It might not seem like much, but it helps to not have the white rectangle sitting there.

The script is available here:  Howrse BannerAd mover

EDIT:  I did manage to write a script that can remove the border entirely which negates the need to move the box the banner ad is displayed in.

That script is available here: Howrse BannerAd Border remover

Without the Greasemonkey script moving the Banner Ad or, alternately, removing the border for the banner ad:

With the Greasemonkey Script moving the Banner Ad and/or removing the border of the banner ad:

Due to the impending changes to the default horse coats I’m working on a script that changes what image is displayed for the horse based on breed and coat color or simply what url is being used for the coat.

Advertisements

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