Implementing browsingData and contextMenus API of Web-extension on android.

This was something which was on my mind for about some time and I am really glad that I finished writing this down. We recently passed our second evaluation period and have done some major work on implementing browsingData API. But still, there is a lot more which is needed to be done. The path we’ve walked so far was not an easy one and there are some components of browsingData API that are still not yet complete. We’ve recently landed some methods of the browsingData API, so, that’s a good thing :)

So, let me fill the gap for you and start from the beginning. I’ve been working for about two and a half months on implementing browsingData and contextMenus API of web-extension on android. This project is being done as a part of GSoC. So far, it’s been a great experience working with awesome people of Mozilla community.

Abstract From Proposal:

We will be implementing browsingData and contextMenus APIs of WebExtension (a cross-browser system) for android firefox. There are some bugs related to web-extension, which will also be resolved under this project. Detailed overview can be found at

I started with implementation of browsingData API. The present state of methods are as follows:

Also, If you want to track our progress, you can do it from here. Its a tracking bug.

Problems Encountered: The main blocker which we are facing, is related to the implementation of the removeHistory method. This method can clear records of web pages visited after a certain time. This is something which is not yet supported. We generally remove all history. The problem is, history in android firefox is stored in two tables in database. The first one is history table which contains history_guid, last_visit_date, visit_type, visit_count, etc and the other one is Visit table which stores data related to each visit made. The task is to remove visits from visit table safely and update the history table with the new values(like visit_count, last_visit_date, etc). And all this is needed to be done in sync safe manner. Grisha has been helping me a lot to solve this issue.

A Big Thanks To

The things we’ve accomplished so far will not be possible if not for Sebastian Kaspari. Sebastian is the one who is mentoring this project. He has been really a great mentor. I really want to thank him, for his quick responses and the help he has provided so far. Other members of Mozilla community have also helped me on various occasions. Matthew Wein, who reviewed early patches of browsingData API, Bob Silverberg, Grisha, these are some names from a long list, who helped me understand how things works and guided me to accomplish certain things.

This is not the end, we’ve come so far and still got a long way to go! I hope we will be able to finish all our tasks. Feel free to comment and share your views. Will post further blogs to keep you updated and thanks for reading!