Vectorspace's Greasemonkey Scripts |
||
| Excuse
the low quality site - I'll build a better one one of these
days... :) I am Vectorspace: Electronic Engineer, Firefox fan and Moderator on the Mozillazine forums. And, I've decided to learn JavaScript. Learning by doing is the best way to learn, so I'm learning by writing Greasemonkey scripts. Greasemonkey is an extension for the browser Mozilla Firefox. It lets you to add bits of JavaScript (known as "user scripts") to any webpage to change and customise it's behavior. It allows you the user to modify the behaviour of any web page in any way, either by downloading scripts from the internet or by writing them yourself. Below are the Greasemonkey scripts I have written and am working on. |
||
Greasemonkey ScriptsTo install any of these scripts, first install the Greasemonkey extension (I'm going to assume that you already use Mozilla Firefox). If you have the extension installed, click on the link to the script to view it, then click Tools > Install This User Script...More information (and likely better instructions) can be found on the Greasmeonkey Homepage. |
||
PvPonline Archive Bookmarker 3.0Current Version - 3.0 (29/11/2007)
Script: pvparchivebookmarker30.user.js Userscripts.org page: http://userscripts.org/scripts/show/1835 For PvPonline.com - Adds the ability to mark your place when reading through the archives. Changes from version 2.0 - updated for the Nov 2007 redesign of the PVP website.. Changes from version 1.0 - completely re-written for the re-designed PvPonline website, and now uses script preferences instead of a cookie to store the page. PvPonline is a webcomic drawn by Scott Kurtz, which following the antics of the staff at a gaming magazine. This script adds two links to PvPonline.com's navigation bar: ![]() Clicking 'Save Placemark' will save the address of the comic you are viewing. When you next visit the site, you can simply click 'Goto Placemark' to go back to the placemarked comic and continue where you left off - useful if you are reading through the archives. Links are visible on the homepage and any comic in the archive. The function of this script was inspired by the website for the webcomic Scary Go Round, which has a similar function built-in. Tech stuff:
The Mows Archive Bookmarker 1.0Note: Since the Mows website was redesigned to be 100% Flash driven, these scripts no longer work.Script: mowsarchivebookmarker10.user.jsFor mows.com - Adds the ability to mark your place when reading through the archives. The Mows is a webcomic about the daily life of three housecats, and is drawn by Jay Dyke. This script adds two links below the comic: ![]() Clicking 'Tag This Comic' will 'tag' the comic you are viewing. When you next visit the site, you can simply click 'Goto Tag' to go back to the tagged comic and continue where you left off - useful if you are reading through the archives. Tag This Comic is visible on any comic page. Goto Tag is only visible if a tag is detected. An archive page for the latest comic does not exist, so tagging the latest comic will always point to the latest comic - rather than to the comic which was latest at the time, which is how the PvP bookmarker works. Tech stuff:
Issues:
Do not use this script at the same time as version 1.0, and read the above issues before using. |
||
Works In ProgressBelow is a list of scripts I am writing or am planning to write. |
||
I.E. Media Mimic 0.8.6bCurrent Version - 0.8.6b (05/09/2006)
Status: Continuous development. Script: iemediamimic086b.user.js Userscripts.org page: http://userscripts.org/scripts/show/4278 This script is still under testing so it may be buggy, and is assumed to be Windows-only (I don't have Linux or a Mac to test it on personally). Please report any bugs or issues in the testing thread over at the mozillazine forums, or by e-mailing me through the Contact section, and please read the known issues before using. For any site - This script attempts to mimic the way Internet Explorer handles embedded audio/video embedded in web pages. When activated by the user, it modifies all embedded audio/video clips in a web page (if the file type being played is in an internal list) so that they play in Firefox more like how they play in Internet Explorer. WMP ActiveX objects and bgsound objects are also converted. If the script cannot convert based on the file extension, it will look at the MIME Type in the type attribute. To convert a page, click "Tools" > "User Script Commands" > "IE Media Mimic: Convert Page", ot hit Ctrl+Shift+C. The page will refresh and then convert. The page will refresh, so anything you have typed into the page may be gone. To perform a Quick Convert (converts without refreshing), click "Tools" > "User Script Commands" > "IE Media Mimic: Quick Page", ot hit Ctrl+Shift+C. The page will convert instantly. Some pages cannot be fully converted by Quick Convert. For such pages, an error box will appear after conversion, offering to perform a full convert. To change the Script's options, click "Tools" > "User Script Commands" > "IE Media Mimic: Settings" Menu Items: ![]()
New in 0.8.6b:
Details: It was written assuming the converted media would be played with the WMP plugin, which of course is Windows-only. I don't know what affect it would have on other platforms, but I'd welcome feedback on what it does if run on those platforms. When Internet Explorer happens upon a video clip or audio file embedded in a web page, it will play it with Windows Media Player if it can - which it can unless it is a proprietary format like Quicktime or Real Player. It decides if it can based on the file extension. Firefox will look at the MIME type for the file and look through its plugins for a plugin that lists that MIME type. If it doesn't find one it throws a missing plugin alert. The Windows Media Player plugin (all browsers except for Internet Explorer use this to play Windows media) only lists the proprietary Microsoft formats (.asf, .asx, .wm, .wma, .wax, .wmv, and .wvx), and Quicktime and Real Player only list their proprietary formats too. So for any other format (.mpg, .wav, .midi, and .mp3, to name a few, very common formats), Firefox will throw up a missing plugin alert even though it already has all the media player plugins. It is possible to configure the Quicktime plugin to play these formats, but few people know this. In addition, many instances of embedded media are only tested in Internet Explorer, so many use parameters that the WMP plugin doesn't understand (e.g. loop, uimode, hidden), or specify values for those parameters that the WMP plugin doesn't understand (true/false as opposed to 1/0). When triggered by the user (or automatically on page load, if set to) this script will look for every media file embedded in a web page and if the file type is in a predefined list, it will modify the way it is embedded so that it will open with the Windows Media Player plugin. Then, it will modify/change the parameters so that they will work with the WMP plugin like they would in IE. Also converts bgsound and ActiveX objects to make them playable in Firefox. If it cannot convert an object based on the file type, it will use the MIME Type instead. Known Issues:
Technical Details: It works by finding the file extension of the file to be played. If that file extension is in an internal list of media file types, the script will alter the player to make it open with the WMP plugin. It will then, assuming the player was tested only in IE, modify the player parameters so they behave in Firefox more like they would in IE. If it cannot convert by the file extension, it looks at the type attribute for the MIME Type. A Missing Plugin Alert may still be seen, but that is unavoidable.
ContactFeedback? Suggestions? E-mail me at vs_greasemonkey@ntlworld.comAny e-mail sent to this address that is not related to my Greasemonkey scripts will be ignored. LinksUserscripts.org: http://userscripts.org/Greasemonkey script archive. My Userscripts.org page: http://userscripts.org/people/1225 Jim Robert's Greasemonkey Scripts: http://userscripts.org/people/566 Jim helped me get started with Greasemonkey (mostly by letting me examine his scripts) and was until recently a fellow Mozillazine forums mod. He has some more great Greasemonkey scripts, which I'll try and find links to. Dive Into Greasemonkey: http://diveintogreasemonkey.org/toc/ Free online book about Greasemonkey programming. Excellent beginners guide(I wish I had found it eariler - it would have made writing these scripts much easier!). Greasemonkey Homepage: http://greasemonkey.mozdev.org/ ![]() ![]() ![]() |