Hacking Facebook app on Firefox OS

With Firefox OS 2.5 add-ons are also available on Firefox OS. Add-on support is one of the most loved feature of Firefox browser. I’m sure you will soon love it on Firefox OS too.



What’s great about Firefox OS add-ons? They are even more powerful and can customize whole phone experience, not just the browser. You can hack and tweak home screen or system apps like email app or messaging app and also all apps (or websites) that you download on your phone either via Firefox Marketplace or anywhere else.



Sounds exciting doesn’t it? Well let’s do it!



We have recently launched a foxfooding program (Firefox OS dogfooding program) and distributed more than 500 foxfooding devices to improve Firefox OS. One of the most used apps for Firefox OS is Facebook app. As many of you know Facebook experience is not the best on Mobile Web platforms. Mark Zuckerberg revealed that one of the biggest mistakes (in 2012) was betting too much on HTML5 rather than native applications. Well it’s 2016 so let’s give it another shot and see how much has the Web platform improved.



Many of you are familiar with Facebook app for Android. One thing you quickly notice is that the menu bar always stays on top.



The user experience on Firefox OS is different. When you scroll down, the menu does not stay on top, so you need to scroll back to top to see recent notifications.



I quickly got an idea to implement “Facebook Top Menu” enhancement for Firefox OS. When I asked fellow Mozillians if that would be useful for them I didn’t get single negative reply.

So I took my shiny new Firefox OS device and quickly developed first working add-on that adds expected functionality.



After debugging Facebook app and injecting some code via add-on you can already see the difference in UX.

Left picture - before and right picture - after with add-on.



It’s currently a big hack and has many bugs, but it kind of does the job.



Feel free to improve it and submit pull request. It’s on GitHub.



It’s also already available on Firefox Marketplace so you can install it on your Firefox OS (version 2.5 or more) phone, don’t forget to restart the device after you install add-on.



I also encourage you to get involved with Firefox OS add-ons. We have great tutorials to get you started.





Till next time …

Cheers, Nino Vranešič

