It feels like I haven’t written in years. The reason for this is that none of my projects really fit into a great topic for my blog. But now I have found something that may be interesting for you, perhaps from a theoretical or technical perspective.
If you deal with bookmarks and synchronization, you’ve surely heard about an extension called “XMarks,” which was initially called Foxmarks. If you dig into its source code, you will still see a lot of old, unnamed function calls with the name Foxmarks. But I think you are not interested in a story about XMarks and its history, but rather in how to get this thing to synchronize your bookmarks to your local hard drive (which is the topic I will start discussing in the next section).
I had a lot of problems with XMarks, starting with synchronizing bookmarks over a WebDAV server because XMarks doesn’t encode your password before sending it to the server. This results in strange error messages about an unreachable or missing server. However, if you encode the password yourself, everything works fine… So keep an eye on any special characters, like hashtags, in your password. This issue is reported somewhere in the XMarks forum universe, along with some requests to fix it dating back to mid-2015. It seems they are not interested in supporting their extension in a user-driven way. That’s 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 where I would replace the password with an encoded one, but because this function is small and straightforward, I tried something else. What this function does is take your username, password, and server URL and build a connection string that looks something like “https://TheUsername:ThePassword@yourserver.com/TheBookmarksfile.jim" and then returns it. This means that this is the central function where the file’s location is determined. Encoding the password was my first intention, but after thinking about it for a few seconds, a better idea came to mind. What happens if I 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, and server. After that, I clicked “synchronize now,” but it reported an error. I thought about it again and clicked the “upload” button, and I saw that a file named FirefoxBookmarksBackup.jim was created successfully—the sync is working like a charm. There have been several requests for a feature like this in XMarks, but I think they have more important things to focus on than implementing such a “non-business use” function. While this modification is easy to implement, I cannot recommend it because it is unsupported and may violate some privacy policies if they catch you doing this. :)
If you have any questions about this, let me know in the comments!