# Intro and basic questions about extension development for Firefox on Android

**URL:** <https://discourse.mozilla.org/t/intro-and-basic-questions-about-extension-development-for-firefox-on-android/121357>\
**Category:** Development\
**Created:** [July 25, 2023, 12:26am UTC](https://discourse.mozilla.org/t/intro-and-basic-questions-about-extension-development-for-firefox-on-android/121357 "2023-07-25T00:26:07Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![bitrat](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@bitrat](https://discourse.mozilla.org/u/bitrat)\
**Post date:** [July 25, 2023, 12:26am UTC](https://discourse.mozilla.org/t/intro-and-basic-questions-about-extension-development-for-firefox-on-android/121357/1 "2023-07-25T00:26:07Z")

</div>

Hi,

I really hope this question isn’t too broad. I know there’s documentation that would probably have answers, but not necessarily succinct or applicable ones.

So, I’m completely new to Firefox development and only motivated by my own desperate need.

My problem is that, afaik, no Android browser provides a bookmark export function. All rely on a variety of sync.

So, I need to write an extension to export bookmarks from the Firefox Android browser.

I don’t care if I’m the only person on the planet who uses it, so I’m not looking for advice on acceptance or distribution, just the most basic tools required to accomplish the task itself, on my own phone.

I had a quick look the problem a few months ago. I’ve forgotten the details but I recall it looked like it might be easier to copy bookmarks to the clipboard than save them to a file. If so, that would be completely acceptable. Also, I only need the contents of places.sqlite .

Maybe something like this already exists, in which case I’d welcome a link!

Any advice greatly appreciated!

Cheers,  
bitrat

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [July 25, 2023, 7:36am UTC](https://discourse.mozilla.org/t/intro-and-basic-questions-about-extension-development-for-firefox-on-android/121357/2 "2023-07-25T07:36:10Z")

</div>

I was about to say, “this is gonna be a piece of cake to implement”, but actually now I see it’s not possible to do it at all.  
Sadly, the Bookmarks API is missing completely in the Firefox for Android:

> **[bookmarks - Mozilla | MDN](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/bookmarks)**
>
> The WebExtensions bookmarks API lets an extension interact with and manipulate the browser's bookmarking system. You can use it to bookmark pages, retrieve existing bookmarks, and edit, remove, and organize bookmarks.

In any case, as you mentioned you can use Firefox Sync. to synchronize them with desktop and then export it from there.  
Note that unlike other browser, Firefox Sync. is using E2E (end-to-end) encryption so all your data are encrypted before they are synchronized to Mozilla server, so not even they can see your bookmarks.

Plus it’s all opensource.

---

<div class="post-metadata">

**Author:** ![bitrat](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@bitrat](https://discourse.mozilla.org/u/bitrat)\
**Post date:** [July 25, 2023, 8:30am UTC](https://discourse.mozilla.org/t/intro-and-basic-questions-about-extension-development-for-firefox-on-android/121357/3 "2023-07-25T08:30:36Z")

</div>

Thanks [juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar), it’s good to know, but disappointing… Unfortunately sync is completely useless to me.

Do you know why the bookmarks API is missing? Presumably the application itself has access. It seems almost deliberately obstructive, especially when the same tactic is being deployed by every other browser…

But, as you say, it’s open source! I’m sorely tempted to fork my own version, except I’ve never worked on any browser code and never done any Android development, ,

No time like the present I guess! 😃

Cheers,  
bitrat

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [July 25, 2023, 8:48am UTC](https://discourse.mozilla.org/t/intro-and-basic-questions-about-extension-development-for-firefox-on-android/121357/4 "2023-07-25T08:48:04Z")

</div>

Don’t look for any conspiracy in this case 🙂, the API is missing simply because it was not yet implemented.  
Firefox dev. team (and especially the Android dev. team) is understaffed and things are moving forward sloooooooooooooowly.

BUT there is a good news! The API is planned and has a good priority P2:

> **[1796597 - Add API support for bookmarks extensions in Fenix](https://bugzilla.mozilla.org/show_bug.cgi?id=1796597)**
>
> NEW (nobody) in GeckoView - Extensions. Last updated 2022-11-27.

  
So who knows, maybe even later this year!

---

<div class="post-metadata">

**Author:** ![bitrat](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@bitrat](https://discourse.mozilla.org/u/bitrat)\
**Post date:** [July 25, 2023, 9:43am UTC](https://discourse.mozilla.org/t/intro-and-basic-questions-about-extension-development-for-firefox-on-android/121357/5 "2023-07-25T09:43:36Z")

</div>

Woohoo thankyou! That’s fantastic news!

I didn’t mean to cast suspicion on the hardworking devs… :#)

I was just working from my advantage of never having seen the source to determine that it would be trivial to implement. 😃

I remember I did some experimenting with the bookmarks API, as I mentioned, but I don’t remember what with… Javascript? I mean, what’s the minimal canonical approach to writing such an extension for desktop?

I’ve been thinking about a more intelligent bookmark manager for desktop and I’ve been using sqlite and python directly, but it would be nice to be able to use it from the browser…

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [July 25, 2023, 11:05am UTC](https://discourse.mozilla.org/t/intro-and-basic-questions-about-extension-development-for-firefox-on-android/121357/6 "2023-07-25T11:05:08Z")

</div>

Yes, you’ll need some JavaScript skills to write an extension 🙂.  
The API should be pretty easy to use, just check the documentation I’ve linked before.

For example, this single call will get you the whole bookmarks tree:

> **[bookmarks.getTree() - Mozilla | MDN](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/bookmarks/getTree)**
>
> bookmarks.getTree() returns an array containing the root of the bookmarks tree as a bookmarks.BookmarkTreeNode object.

But all depends on what you want to do with it. Implementing a bookmark manager is not gonna be easy at all 🙂.

But implementing simple export should be, since all you need to do is serialize the tree into some text format (depending on your needs) and then download the result file - either by using official “downloads API” or some popular workaround (there is a few).

---

<div class="post-metadata">

**Author:** ![bitrat](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@bitrat](https://discourse.mozilla.org/u/bitrat)\
**Post date:** [July 25, 2023, 11:36am UTC](https://discourse.mozilla.org/t/intro-and-basic-questions-about-extension-development-for-firefox-on-android/121357/7 "2023-07-25T11:36:15Z")

</div>

Hi, yep, pretty sure I already looked at exporting in my earlier experiments. After some archaeology, I see I hacked around with these examples: [https://github.com/mdn/webextensions-examples](https://github.com/mdn/webextensions-examples)

My bookmark ‘manager’ idea is more of a bookmark spider with some learning, probably not suited to running in a browser, but I’d like to integrate it, probably via an http api.

It’s not a priority though. Top of my list is exporting bookmarks from my phone!

---

<div class="post-metadata">

**Author:** ![bitrat](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@bitrat](https://discourse.mozilla.org/u/bitrat)\
**Post date:** [July 25, 2023, 8:20pm UTC](https://discourse.mozilla.org/t/intro-and-basic-questions-about-extension-development-for-firefox-on-android/121357/8 "2023-07-25T20:20:20Z")

</div>

I have a couple more questions:

Is the new ‘collections’ scheme a complete replacement for bookmarks (ie, is the entire ‘bookmarks’ system deprecated? wtf???).

Is there an equivalent for ‘about:config’ on the android browser, or any mechanism for installing a temporary extension?

Cheers,  
bitrat

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [July 26, 2023, 7:35am UTC](https://discourse.mozilla.org/t/intro-and-basic-questions-about-extension-development-for-firefox-on-android/121357/9 "2023-07-26T07:35:37Z")

</div>

I think the purpose of collections was something else, but I can’t remember what. Maybe to store current session as a collection and continue it later on. Or even to switch between sessions.  
I’ve tried to use it years ago but it had some issues (content was always cached and I had to reload each tab each time, or something like that).

Don’t worry, bookmarks are not going anywhere anytime soon (said by a guy whose main addon is basically a “bookmark replacement” 😃).

Regarding the about:config, you need Firefox Beta or Nightly for that, it’s disabled in Release channel in Android. Same applies for not-recommended addons, they are currently restricted to Beta and Nightly, but general support seems to be wip.

Here is the article for extensions development in Android:

> **[Developing extensions for Firefox for Android](https://extensionworkshop.com/documentation/develop/developing-extensions-for-firefox-for-android/)**
>
> Get help creating & publishing Firefox extensions.

It’s pretty hard to set it up first, but then it’s OK.

---

<div class="post-metadata">

**Author:** ![bitrat](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@bitrat](https://discourse.mozilla.org/u/bitrat)\
**Post date:** [July 27, 2023, 1:43am UTC](https://discourse.mozilla.org/t/intro-and-basic-questions-about-extension-development-for-firefox-on-android/121357/10 "2023-07-27T01:43:18Z")

</div>

Thanks for this link. I did delve into Android development once before, and I discovered I don’t have much patience with it, but I’m inspired to have another look (unless I just root my phone and download places.sqlite). 😃

Also good to hear that about bookmarks. I think I read an old thread expressing a lot of sturm und drang over collections replacing them, but maybe it was a panic.
