Skip to content

Blog

Making EMF models serialized in XMI available in JSON with emfjson

This post is archived. It is left as is and won't receive updates.

This summer we had two interns in our team at the Software Engineering Lab who started creating a web application for our TouchCORE tool. I have wanted this for a long time. Not only does it allow you to model in your browser, you can also do this collaboratively! For now class diagrams are supported but more supported will be added in the future (for example for sequence diagrams and feature models).

Migrate (Legacy) Thunderbird add-on to MailExtension for Thunderbird 68

Like with Firefox, Thunderbird is also changing add-ons to WebExtensions (called MailExtension there). Thunderbird 68 introduced this requirement. Users on older versions still are not offered the latest version through the automatic updater so it stayed below my radar.

Recently, some users of my Toggle Headers extension reached out to me asking whether I intend to update it for Thunderbird 68 and later. I finally got a chance to migrate it and it was fairly easy in my case.

The easiest way is to convert it to a MailExtension with legacy support that allows to keep the old XUL stuff. The main changes I had to do were:

  • Replace install.rdf with manifest.json: This is really straightforward given the documentation
  • Add a legacy key to the manifest. Some examples showed "legacy": true but that did not work. Instead, you need to specify:

    "legacy": {
        "type": "xul"
    }
    
  • In the chrome.manifest I had overlaid mailWindowOverlay.xul. This had to be changed to messenger.xul. See the note on overlaying.

With this, the extension can be packaged up (now with a nice little ant build script that automates this) and uploaded to Thunderbird's add-ons site. Luckily, there it passed the review with no complaints and version 2.0 is now available.

I think it should be possible to accomplish this without any old XUL stuff. There is a MailExtension API documentation that outlines commands. Since users mainly use the add-on for the convenient key shortcut (H) this seems feasible. But that's for another day 😅.

How to drag music and videos onto iPhone/iPad using iTunes

This post is archived. It is left as is and won't receive updates.

On an iPad I previously simply dragged some videos on to the device in iTunes to copy them onto it. For some reason this did not work for my iPhone when I tried to do the same. You can of course add the media to the iTunes library and select to sync it on to the device that way. But if you don't want to manage your media through iTunes that's cumbersome.

To be able to do this without using the iTunes library, the option "Manually manage music and videos" needs to be enabled. You can find it on the Summary page of your device under the Options section at the bottom. Click Apply after and now it should work.

Deploying Angular application on Apache server

If you need to deploy an Angular application on a server running Apache, and are making use of routing for navigation, you can't just upload the built application onto the server and be done with it. As soon as you navigate to another path, the Apache server will try to look for that resource on the server and most likely will give you an 404 Not Found error.

You need to rewrite all the URLs to the index.html so that the Angular application can take care of it. Your server needs to support mod_rewrite for that. If that is the case, you can upload a .htaccess file with the following content to your directory where the Angular application resides in:

RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/assets/(.+)$
RewriteRule ^(.+)$ index.html?path=$1 [L]

This will rewrite all requests to the index.html file and append any extra path to it. Unless, the request is for an existing file or directory on the server, then it will not rewrite it. This is necessary for the additional resources that will need to be loaded, such as CSS and JS files and images.

In order to get the necessary feedback when a resource is requested that does not exist, the third condition excludes to rewrite any request located inside the assets folder.

Digging into the Firefox UI for the tab close button

Last year a new Firefox version broke the "close button on tab hover" tweak and I mentioned I will write a separate blog post on how I found out why and how to fix it. Life happened, but fortunately I wrote down bullet points about what I did.

It seems that with Firefox 54 something in the UI changed which broke the functionality. Fortunately, it wasn't the removal of the ability to customize the UI using userChrome.css. In order to find out why the CSS selector didn't work anymore, it was necessary to see how a tab was structured in XUL.

A while ago I used DOM Inspector which now is a legacy extension. The Firefox version at the time was 57, but it didn't allow legacy extensions anymore. So I went back to the last 54.x version, which allowed the installation of this "legacy" extension. Unfortunately, I could not open its UI. I did however find the extension InspectorWidget. It has a nifty shortcut to open the inspector for the desired element right away. Hold Ctrl+Shift while clicking on the desired UI element.

Using the inspector I found out that there was a new CSS rule that set display: none for certain elements, one of them being the close button for tabs. To find out the initial/default value I used the computed rules, which showed -moz-box. This allowed to add display: -moz-box !important to the rule for hovered tabs to make it work again.

While it doesn't seem possible to inspect the UI anymore with "Firefox Quantum" due to the introduction of WebExtensions, the CSS rules still work. However, it is unclear whether these kind of UI customizations will stay. There seemed to be plans to remove it but perhaps they realized how many users are using this to tweak their UI since extensions are not allowed to do it anymore. This bug report to collect usage of userChrome.css supports this theory.

Update (2023): In the last few years there has been a much easier (built-in) way to inspect the Firefox UI using the Browser Toolbox. See this post on Super User.

AirDrop on macOS working unreliably

This post is archived. It is left as is and won't receive updates.

AirDrop is quite convenient to send files to a colleague or another device without having to send an email or uploading it somewhere. At some point (I forgot with which exact OSX version), AirDrop was updated and required Bluetooth. Since then, it often occurs that the device I want to share a file with does not appear. However, there is this option to "Search for older Macs". In the past, I've only used it to send files to a Mac running an older OSX version.

However, as it turns out, even for newer macOS versions, if this is done on both devices, it works much better and the device appears almost immediately.

Firefox close tab button on hover

There are probably extensions that allow to do that, however, this is not necessary as I will show in this post. Maybe you've seen the functionality in Safari or just wondered why the close button for tabs in Firefox can't just always be there. In Safari, the close button appears when hovering over the tab itself.

iOS: How to fix/change Voicemail number

This post is archived. It is left as is and won't receive updates.

Recently, a friend's voice mail button did not work anymore. Upon calling the voice mail, an audio error message appeared saying that the voice mail is not available or cannot be reached (something like that).

Unfortunately, Apple does not want you to just change the associated voice mail phone number that is called when tapping on "Voicemail".

Fortunately, there is a shortcut:

  1. Go to the phone's keypad
  2. Dial *#5005*86# and "call it"
  3. A phone number will appear, which is the one currently associated with the voice mail. Write this down just in case.
  4. Now, call *5005*86*<insertPhoneNumber># and replace the placeholder with your phone number, starting with the country code (1 in this case for North America). For example, 14381234567.
  5. The voice mail button should now work.

This approach worked on the TELUS network (using Koodo). If it doesn't work for you, revert the phone number to the one written down in step 3 and contact your provider.

Source: planken.org

Thunderbird Extension: Hide Badge Icon

This post is archived. It is left as is and won't receive updates.

About two years ago (a few months after switching to Mac OSX) I noticed that the badge on the Thunderbird app icon is quite distracting for me while I work (it notifies about new and how many emails were received). As soon as it pops up I would notice it and felt an urge to immediately check what the new email is about. Then of course, the current focus and concentration is lost.

I wanted to turn the badge of, as this is generally supported on OSX. However, I found out that this is not the case with Thunderbird.

Note

This functionality is supported natively with newer versions of Thunderbird.

I didn't give up easily and went to search the Internet. Unfortunately, no one had attempted this, complained about it or filed a bug report. Also, I could not find any documentation about this on the Thunderbird pages.

I wanted to know more and started digging into the source code of Thunderbird. An advantage of open source software. Because this is a Mac OSX specific thing, searching for files related to OSX seemed logical. Eventually, I found the file nsMessengerOSXIntegration.cpp (it is now nsMessengerOSXIntegration.mm) where the logic for this functionality is implemented. While I did find an interesting piece of code, the revisions also were helpful, which led me to bug report #274688. In this bug report a hook was introduced which allows to observe a property called before-unread-count-display. Upon notification, the desired badge label can be modified/adjusted (e.g., making 100+ for all counts greater than 100) before it is displayed. If an empty string is returned, however, the badge will be hidden.

And that was it. I digged into it and found an (unfortunately) undocumented extension feature. This allowed me to write an extension with the purpose of hiding the badge in all situations. I have actually used it for more than two years. My intention was always to release it and share it with others, but kind of put it off. Since I was updating my other extension anyway, I finally did it.

To my surprise, it was fully reviewed without any complaints right away. So if you want to work without distractions, you can now use Hide Badge Icon to hide the badge of the Thunderbird app icon.

Thunderbird Extension: Toggle Headers Updated

My Thunderbird extension Toggle Headers was running smoothly for a long time. It only needed to be kept aligned with the Thunderbird version updates (for the maximum supported version of the extension). Everything was fine until the third-party extension CompactHeader, which is supported by Toggle Headers, released a new version with internal changes. These changes involved some refactoring, which meant the function to toggle between the compact and expanded header pane had a different name (or namespace).

The way I noticed this, since I don't use CompactHeader myself, was by receiving a 1-star review. Of course, no proud developer likes this. Generally, I prefer to be contacted directly with bug reports and be able to respond before receiving a review. If a developer doesn't respond, a bad review is then acceptable. However, in this case bad reviews could be turned into very good ones, so no complaints in the end 😄.

Long story short, a new version of Toggle Headers was released. Basically, Toggle Headers v1.0 restores support for CompactHeader 2.1.0 and higher, but at the same time, it still works with older versions. Unfortunately, the new version of CompactHeader contains a bug that prevents toggling between the header modes (Normal/All) to work properly. I reported the bug in the referenced support forums, but haven't received a response to date.

This required a workaround to be integrated into the new version. When switching from collapsed header pane and Normal to All headers and then back to Normal, the header pane would stay expanded. The Compact option however is checked in the menu. The workaround simply disables and enables the compact header again to make it work until a fixed version gets released.

The same kind of story happened with another extension. An extension I never heard of named Phoenity Buttons made my extension not work anymore. This was due to the usage of the same key shortcut (H). Somehow Thunderbird gave precedence for the key binding to that extension. Fortunately, the developer of this extension was very helpful and even willing to change his key binding to another one 👍.

All in all, a great experience with the Thunderbird extension and user community.