jump to navigation

On locale maintenance. February 15, 2007

Posted by andy in : coding, screengrab , 2 comments

I just had a thought.

The whole point of locales is to externalise the language from the extension code into translatable blocks that reside in a separate area. Currently this resides inside the extension, but why not have it reside on a remote server and cache it locally?

Obviously your extension could ship with whatever translations it has, but if the person using it was French and you didn’t include an fr-FR version then it could connect to a server (let’s say Babelzilla) and request it from their servers (Babelzilla hold all of the translations anyway). If it was there, it would be downloaded and incorporated into your extension somehow (this bit is where the magic happens).

Translations would be tied to a particular version, so when a developer releases a new version, you could log in to their system and roll forward all translations or deprecate them. Then any new translations could be easily made and added to your extension without you actually having to do anything.

If people wanted a particular translation, then they could request it through the extension that managed all of this dynamic locale stuff, or they could just write a translation and submit it.

I think this is a great idea. I must ask Goofy what he thinks.

Pending Screengrab release

Posted by andy in : coding, screengrab , 6 comments

So I’m working on a new Screengrab release (which will coincide with changing the look of the website, so that it’s a little less bloggy and a little more about Screengrab).

The new release will feature some new features and bug fixes.

1) Fixed horizontal scrolling bug. Somehow horizontal scrolling got lost along the way. Either I stuffed up or it was changed in Firefox. Either way, it’s fixed now.

2) Grabs using Canvas. Firefox 2.0 (possibly 1.5) has full canvas support (notably toDataUrl) so I can now use the canvas instead of Java to do the grabs. We lose the funky scrolling around the page, but we gain much better performance. The Java version will still be kept as an option, as it is required in order to take complete grabs of pages that use plugins (swf).

3) Copy to clipboard. This feature will only work using Canvas, but you can now copy an image to the clipboard instead of saving it to disk.

4) Select a portion to grab. There is now a drag box allowing you to select only a portion of the window to take a shot of.

5) File type choice. This isn’t done yet, but it should make it in. You will be able to select whether you want a JPG or a PNG - we’re limited by what Firefox provides in this regard.

6) File extension bug. There’s currently a problem with ever growing extensions on files. I’ll try to squash this one.

The new release requires changes to lots of text, which will obsolete many of the current locales. I can’t decide whether to hold back the release while I wait for translations or to just go ahead and inconvenience a whole bunch of users.

People don’t talk about how annoying locale maintenance is, but it does hold development back, which is frustrating. I personally feel bad when I go to the Babelzilla guys and say “I’ve re-written the entire interface. Can you please re-write it 15 times too?”. Obviously I completely support it (I don’t want everyone speaking English. Otherwise it would be no fun visiting other countries) I just wish there was an easier way to do locales than bundling them into the extension itself. You have to make a new release every time you want to include a new locale.

GAAARR!!!! January 10, 2007

Posted by andy in : coding, screengrab , 7 comments

Developing extensions for Firefox is like an exercise in futility that pretends to be a challenge and leads you down the path to hell! Or maybe I really am just being too tricky, like Sisyphus, and I’m somehow being punished?

The development cycle for improving or creating an extension is as follows:

1. Think of great idea / Fulfil user request - Copy to clipboard
2. Imagine it won’t be too hard - Just copy some bytes to a buffer somewhere or something - setX(data)
3. Go looking for the Mozilla docs that pertain to the thing you’re trying to do. - surely it’s on “the interweb”
4. Fail. Look harder. - but where?
5. Eventually turn over the correct rock - Of course! I couldn’t find it because both Google and I are obviously too stupid.
6. Discover that the documentation only documents the straight forward text-only path, idly mentioning that you can use this interface to copy images and other stuff as well, but cleverly neglecting to mention the fact that this IS IMPOSSIBLE because there is nothing published anywhere that tells you how to do it.
7. Go looking for a particular component that you think might work but that is hidden deep within some archaic XPCOM interfaces that you can’t possibly find and even if you could, you’d have to trawl through the Gecko source to understand it because the documentation just doesn’t cover it and EVEN THEN, the source is next to useless so you’re just flapping your arms wildly in the air trying to figure something out.
8. Remember that you are part of a “great development community” with “active forums” and post a question.
9. Prepare a cup of tea as you wait for the iminent replies.
10. Watch lots of stupid questions get answered (the ones that Google CAN help on) for days while still blindly searching through source code, reference material and just trying random combinations of things you think could maybe magically work.
10. Give up.
11. Lie awake at night knowing that there HAS to be a way.
12. Start thinking outside the box.
13. Use a completely different approach that involves creating hidden images and hacking around in order to use some existing functionality that you found.
14. Have SUCCESS!! As long as your users will be happy to click an error box a few times and then somehow miraculously have it randomly work.
15. Try the old way again.
16. Harangue yourself for doing something so stupid.
17. Start thinking about doing those other projects you want to do. That game with the lasers and things.
18. Post to blog.

Please. If someone knows how to take an image, either as a Data URL, a series of bytes, or as an HTMLElement/XPCOMWrapper and get it onto the clipboard, tell me how you did it. Then I will tell you that it doesn’t work for me, but at least there’ll be some sort of discourse!

Then we can start trying to do it in Java as well as using the canvas.

Firefox 2.0 Compatibility October 25, 2006

Posted by andy in : screengrab , 34 comments

Okay. I’ve taken 5 minutes out to make the tiny change that can fix this immediately.

I haven’t tested it. I haven’t even downloaded FF2 yet (have I already mentioned that I am absurdly busy?) but I bumped up the maximum compatibility version number so it should work.

This is all the time I can spare for this until mid-December, so I hope it works.

The future of ScreenGrab! June 15, 2006

Posted by andy in : screengrab , 26 comments

It seems that I was dug recently. I must have missed it on the feed, but apparently I got a fair few digs. Yay for that!

The extra interest that this brings, means there are more people trying it out (which is nice) and asking more questions and pointing out bugs and so on. This brings to light the current problem that I have, whereby I’d like to do more work on ScreenGrab (and the other extensions I have planned) but I don’t have much free time what with study, work, wedding plans and a 3 hour round trip commute every day.

I have plans for upgrades, and I have an alpha with a couple of new features, but I just haven’t had time to do anything with it.

The things I’m working on are…
- being able to select a region to grab (using something similar to MeasureIt)
- removing my dependence on Java (much like the folks over at Pearl Crescent did with their PageSaver, based - like I said one would be eventually, on the Canvas widget).
- all those configuration options people keep whining about (default save to location, default naming, different file types, different menu locations)
- making a shortcut key to do the grab

I am also working on a super-secret project that I hope will actually be popular. :)

Is there anything else that people would like? Would anyone like to help? :) I can make a Subversion repository and I have a very easy to use environment for building these things.

Actually, maybe I should make a proper tutorial on how to do this. Making Firefox extensions is dead easy - the hard part is figuring out which parts of the DOM are the useful ones.

Thoughts? Comments?

Screengrab 0.8! February 3, 2006

Posted by andy in : screengrab , 29 comments

And I’ve added 1.5.0.1 support (is that what we’re up to now?)

Screengrab 0.7 December 6, 2005

Posted by andy in : screengrab , 9 comments

Is up.

Check the page if you care. Just a bug fix and some more translations.