Blogger Markdown support user script improved

I've updated the Blogger Markdown support user script (original post) for Greasemonkey.


  • Preview now shows Markdown converted to HTML.
  • Added a link to the Markdown syntax page (open's in a new tab).


Positioning elements inserted by a user script

I needed to insert an anchor element before an other element in my Select element filter user script because I wanted the anchor to fit in the page's existing tab order. Also, I didn't want the anchor to push the other element to the right, so it needed to be positioned absolutely. You might know that you need to position absolute positioned element relative to the root elements or the first non-static positioned parent node. Here's the javascript code I used to determine the anchor's position:

var posY = 0;
var posX = 0;
var currOffsetParent = elementToInsertBefore;
do {
  if (
    document.defaultView.getComputedStyle(currOffsetParent, null)
    .getPropertyValue('position') == 'static'
  ) {
    posY += currOffsetParent.offsetTop;
    posX += currOffsetParent.offsetLeft;
  else break;
} while (currOffsetParent = currOffsetParent.offsetParent);

Select element filter user script: no longer experimental

Finally, the Filter large form selects user script for Greasemonkey is no longer experimental. I decided to fix the two biggest problems of this script: poor positioning and poor usability.

Screenshot of the select element filter user script

Here's a detailed improvements list:

  • Improved, I think even perfect, positioning.
  • The select element is no longer sized, moved or modified. An separate select element is inserted to display the filter results and the magnifier is positions absolutely.
  • It no longer breaks selects with optgroups because of the separate results select.
  • Esc key now closes the filter.
  • You can select a result using the mouse now.
  • You no longer need to tab twice to focus the next form field.
  • The select's onchange function will be executed when the select was changed by the filter (this was broken since Greasemonkey 0.6.4).


Quick and clean blogging using Markdown

I like to write posts in 'Edit HTML' mode because I want to have clean, semantic HTML on my blog. I'm happy that I can use Markdown now to write my posts and convert them to HTML using my user script (based on js-markdown) because this is much faster then writing HTML.

My post announcing the user script had little info on Markdown. I'm not going to copy the complete Markdown syntax here, but I will put a short example in this post to give you an indication of how Markdown can help you writing HTML.

Markdown example:

# Clean & quick HTML writing

This is a [Markdown](http://daringfireball.net/projects/markdown/) example.
It is intended to be as *easy-to-read* and *easy-to-write* as is feasible.

* List item 1 **strong**
* List item 2 `code`

> Blockquoted text

Resulting HTML:

<h1>Clean &amp; quick HTML writing</h1>

<p>This is a <a href="http://daringfireball.net/projects/markdown/">Markdown</a> example.
It is intended to be as <em>easy-to-read</em> and <em>easy-to-write</em> as is feasible.</p>

<li>List item 1 <strong>strong</strong></li>
<li>List item 2 <code>code</code></li>

  <p>Blockquoted text</p>


Omroep.nl direct video link VPRO, ASF and Lama's

This one is for the Dutch readers:

Het Omroep.nl video's direct linken user script (oorspronkelijke post) voor Greasemonkey is verbeterd:

  • Er wordt niet meer aangenomen dat een video bb.iets.rm heet. Door deze aanname konden nieuwe video's van de VPRO niet bekeken worden.
  • Als er een directe link naar een video (rm of asf) gemaakt kan worden wordt dit (nu beter) gedaan. Dit is handig op bijvoorbeeld tv op je pc.
  • Als er via de uitzendinggemist-mediaplayer (de popup) geen breedband rm-video gevonden wordt (Avro.. grr) dan wordt de asf-versie gepakt.
  • Op de site van de Lama's wordt de functie die een popup verzaakt als je een aflevering wilt kijken overschreven door een functie die de video direct toont.


Jasper's Google Reader subscribe user script

I was using Johan's Google Reader Subscribe user script (see the post on his blog) for some time now. I just loved it. The only downside was that it draw a lot of attention and it slowed scrolling down on my laptop. If you've got the same problem you might like Jasper's Google Reader subscribe user script for Greasemonkey. It was designed to use as little screen size as possible. It only adds a feed icon in the top right corner. When you mouse over the feed icon the subscribe links are shown.

I could copy Johan's code but I chose to rewrote the code to experiment with XPath queries. Man, they are powerful!


Implemented improvement suggested by Chris Wetherell.


Userscripts.org myaccount improvements user script

After writing a post on userscripts.org improvement suggestions, I decided that I would write a userscripts.org myaccount improvements user script for Greasemonkey to improve some things on the myaccount page:

  • Scripts are sorted alphabetically
  • Rating and number views are displayed
  • Last comment is displayed

Screendump userscripts.org myaccount improvements


Google open all can now open HTML versions

Thanks to Esquifit's feedback, the Google open all user script (original post) for Greasemonkey can now open HTML versions of PDF files, Word documents etcetera.

Screendump Google open all

It is also no longer based on the first div on the result page which made it interfere with others scripts.

Custom Blogger backlinks speed up

Two moths ago I published a post on how to custom format your Blogger backlinks. The only downside on this script is that your MainOrArchivePage will appear slow because after each item a small Javascript needs to be loaded from blogger.com. Today I wrote a speed up for this. I now only insert a placeholder span and do the rest of the needed scripting at the bottom of the page.

Here is the script to place on the MainOrArchivePage (after the link to the comments for example):

<script type="text/javascript">
document.write('&middot; <a href="<$BlogItemPermalinkUrl$>#links">Links: <span id="BLc<$BlogItemNumber$>">?</span></a>');
if (! BL_BacklinkCount) var BL_BacklinkCount = new Array();
BL_BacklinkCount['<$BlogItemNumber$>'] = document.getElementById('BLc<$BlogItemNumber$>');

Here is the script to put at the bottom of your page (after the Blogger close tag):

<script type="text/javascript">
for (var item in BL_BacklinkCount) {
  document.write('<script type="text/javascript" src="http://www.blogger.com/dyn-js/backlink_count.js?blogID=<$BlogID$>&postID='+ item +'"></scr'+'ipt>');


Userscripts.org improvement suggestions

Userscript.org is a great initiative, it really is. Jesse and Britt are doing a great job responding to feedback e-mails, adding feature and even helping me out by resetting my password in the days you were unable to do it your self. However, there are a few things that I would like to see improved or added.

  • Most important, in my opinion, is an option to be able to receive an e-mail when someone adds a comment to a script you have written. I visit userscript.org every now and then having to go by all my script to find out if there are new comments.
  • When I did a comment check run tonight I found out that my Blogger tag adder script had gotten a negative rating. It would be nice if you could (be forced to) leave a motivation with the rating. My scripts may not be perfect, or you might not like them, but I would like to know why. Also the number of raters would be interesting.
  • I would be nice to have a (filtered) RSS feed on new user scripts.
  • A search box every page would be handy. This can be Greasemonkeyed - in fact, it has been done.

I hope these ideas will be implemented in the coming version of userscripts.org.

Update 2006-01-07: How could I forget this one:

  • Users scripts on your accounts page should be sorted alphabetically.

Update 2006-01-08: I wrote a user script to improve some things on the myaccount page.


Markdown textareas user script

What the heck. After writing a Blogger Markdown support user script for Greasemonkey I could as well write a Markdown textareas user script. It is also based on js-markdown and it enables you to convert Markdown formatted text in textareas to HTML in one single click.

Blogger Markdown support user script

When you prefer to write your posts in HTML, you might be pleased to hear that I've created a Blogger Markdown support user script for Greasemonkey. It is based on js-markdown and it enables you to convert Markdown formatted text to HTML in one single click.


  • Preview now shows Markdown converted to HTML.
  • Added a link to the Markdown syntax page (open's in a new tab).


Initial version


Hotmail rich composer for Firefox 1.5 and Greasemonkey 0.6.4

After many requests for a version of the Hotmail rich composer user script (original post) that would work in Firefox 1.5 with Greasemonkey 0.6.4 I finally had time to update it.

This script had my lowest priority since I don't use Hotmail that much and I expected that Microsoft would upgrade Hotmail (which hasn't happened yet). There was also a lot of code rewriting involved and little time available.



Jagshemash, Happy new year!

Best wishes for 2006!