Making an extension from scratch is tricky, but modifying an existing one is easy: The .xpi file is really just a zip file, that usually contains a metadata file and a .jar file, which once again is just a zip file. Inside that, you'll usually find the javascript source for the extension, which is easy enough to hack.