Playing with user scripts

March 6th, 2010 § 0

I’m taking a rather fun algorithms course with a website that reddit loves but I do not. I decided to turn this dire, lolcat-overloaded, situation into an opportunity to practice some javascript (without jQuery) and to write my first userscript.

User scripts are javascript files with the extension ‘.user.js’ that are executed client-side to add functionality to a web page. They are natively supported by chrome and opera and are supported via extensions in most other browsers of any note. (Some include Greasemonkey for Firefox, GreaseKit for Safari and Trixie for IE).

I succeeded in reskinning the whole website which was pretty fun. There seems to be a limit to the usefulness of userscripts in that support for the ‘@run-at document-start’ flag which I believe should make the script run before any scripts on the page do, is not supported by most browsers. It’s not all that useful a flag anyway as I imagine you’d often want the script to run after the DOM has been written so that you can work with the content expected to be on the page. In this case however it would be useful as I attempt to strip out a script on the course page that redirects 1% of all hits to a rickroll (sigh). As such the script still runs before the userscript and so the rickrolling still happens.

I might also put some more time into the replacement style sheet some time soon.

CS16 course site

OriginalCS16 course site with userscript and restyle

Reshaped and restyled

Code after the break. » Read the rest of this entry «

Newspaper Layout with JQuery

January 11th, 2010 § 0

Is it a good idea to use javascript to completely reshape a website’s design? Columnizer is a JQuery plugin which makes the long wished for and ever intangible vertical wrap CSS feature come to life.

The idea of the feature is to allow for dynamic newspaper style columns on a website. Columns have ordinarily been unachievable though any means but manually separating up content (which would still give unpredictable results).

I’m in the camp that wants the web to be both usable and pretty even with javascript turned off. I’ve missed lots of neat aspects of websites as a result of browsing behind NoScript in past. I think it would be very difficult to make a website designed with such drastic styling done with javascript degrade gracefully in a browser with the tool disabled. However, from a designer’s perspective, this is still one of the most interesting JQuery plugins I’ve seen yet.

Where Am I?

You are currently browsing the web_dev category at zethrae.us/blog.