My first firefox extension

After installing the Firefox 3.0 beta, the majority of my extensions stopped working. I had gotten rather spoiled with them, so I decided it was time to learn about writing Firefox extensions so that I could a)fix the ones I like which aren’t being updated, and b)write my own for the things that don’t exist yet.

For my first foray into writing Firefox extensions, I decided to go with something simple, but which I find useful. So I made PlusOne.

What PlusOne does is quite simple. It finds the numerical part of the current URL you are browsing, and simply adds 1 to it. (You can also subtract 1 from it.) So, if the page you’re viewing is called page1.html, you could right-click on the page and choose “Plus One”, and it will navigate to page2.html. Likewise, if you are viewing britney-spears-naked-17.jpg, you can right-click on the page and choose “Minus One” and it will navigate to britney-spears-naked-16.jpg.

Of course, if the file doesn’t exist, you’ll still get a 404. But often you can discover many interesting, and somewhat hidden, gems just by exploring the possibilities of incrementing the URL. It’s also easier than searching the entire page for the tiny “next” link hidden at the bottom when you’re reading a six-page scientific essay. (Yeah, right… you’re looking for naked pictures of Britney Spears.)

Please try it out and leave any comments on this page.

Stumble this page

Tags: , , , ,

4 Responses to “My first firefox extension”

  1. Gert Says:

    Cool, I still use the JavaScript links you once build for photoSIG, they sit in my links bar as Back and Next and still work like a charm, not just for browsing photoSIG.
    Clicking the PlusOne link above seems to not work… I get No input file specified.

  2. randem Says:

    Oops! Darned relative URLs. I fixed the link.

  3. Gert Says:

    Yeah, it works now, nice and simple.

  4. WindSweptCowboy Says:

    Wonderful extension! Like you I have valued this sort of extension in prior versions of Firefox. Thanks for creating such a useful enhancement.

    Bug report: extension seems to have a problem with leading zeros. That is, when decrementing/incrementing from “06″, your extension drops the leading zero, looking for “5″/”7″ instead of “05″/”07″. :-(

    I formerly used Ezi-Nav extension. I like the functionality of middle clicking on navigation arrow to decrement/increment.

    Thanks again for wonderful extension.

Leave a Reply