It feels like I haven’t wrote since years. The reason for this was, that non of my projects really fits into a great topic for my blog. But now I have found something, that may be interesting for you, maybe from a theoretical / technical perspective.
If you deal with Bookmarks and synchronisation, you surely have heard about an extension called „XMarks“, which was initial called Foxmarks, and if you dig into its sourcecode, you will see alot old unnamed function calls with Foxmarks. But I think you are not interested in a story about XMarks and its history but on how to get this thing synchronizing your bookmarks to your local harddrive (that is the thing I start to talk about in the after next section).
I had a lot of problems with XMarks, which starts with synchronizing bookmarks over a webdav server, because XMarks doesn’t encode your password before sending it to the server. This ends in weird error messages about a not reachable or missing server. If you encode the password by yourself, everything works fine… So keep an eye on a hashtag within your password… This error is reported somewhere in the XMarks forum universe, included with some requests to fix that from mid 2015. It looks like they are not interested in supporting their extension in a userdriven way. That’s the reason why I tried to find the place, where this password is sent to the server and this is, where my little journey started.
If you install the addon, you can find a „Foxmarks@kei.com“ folder under your extension directory. We are interested in a file called „modules\settings.jsm“ and a function called „getUrlWithUsernameAndPassword“. This is the place, where I would replace the password with an encoded one, but because this function is small and clear I tried something else. What this function does is, it takes your username and password and your own server url and build a connectionstring that looks similar to something like „https://TheUsername:ThePassword@yourserver.com/TheBookmarksfile.jim“ and returns it. That means, this is the central function, where they return the location of the file. Encoding the password was my first intention, but after thinking about it a few seconds, a better idea came to my mind. What happens if I only replace the return command with something like
I saved this file and started Firefox.
First I had to activate „use own server“ and fill in some fake information about my username / password / server. After that I started to click synchronize now, but that reported an error. I just thought about it again and clicked the „upload“ button and can see, that a file FirefoxBookmarksBackup.jim was created successfully – the sync is working like a charm. There are several request on why not create something like that in XMarks, but I think they have way more better things to do, than implementing such a „non business use“ function. Nevertheless this can be modified easily, I cannot recommend this, because it is unsupported and maybe against some privacy use rights if they caught you doing this. 🙂
If you have any questions about this, let me know in the comments!