Trying to make a mobile bookmarks addon, getting warning and errors

I don’t like how Firefox mobile handles bookmarks, (it takes way too many clicks for bookmarks, and collections don’t sync with desktop Firefox.)

So I decided to make an add-on to provide a better interface for bookmarks. Following along with the instructions at Your second extension. I was able to make an addon that displays a popup with your bookmarks, remembers what folder you were last in, and lets you click them to open a new tab that works on desktop Firefox. (Planning on doing more than that eventually, but it’s a good start.)

I then followed the instructions here to try to get the addon into Firefox mobile, (nightly build for now, I’m hoping for the stable line soon.) Lint didn’t find any problems with my addon. I run the “web-ext run” command and Firefox nightly loads up on my phone, but the addon’s button is no where to be found. I run the about:debugging page on my desktop and connect to the mobile device and it shows a warning, (not error, just a warning) that says the following:

Reading manifest: Warning processing permissions: Error processing permissions.0: Value “bookmarks” must either: must either [must either [must either [must either [be one of [“idle”], be one of [“activeTab”], be one of [“cookies”], or be one of [“webRequest”, “webRequestBlocking”]], be one of [“clipboardRead”, “clipboardWrite”, “geolocation”, “notifications”], be one of [“browsingData”], be one of [“tabs”], be one of [“browserSettings”], be one of [“downloads”, “downloads.open”], be one of [“management”], be one of [“privacy”], be one of [“proxy”], be one of [“nativeMessaging”], or be one of [“webNavigation”]], be one of [“alarms”, “mozillaAddons”, “storage”, “unlimitedStorage”], be one of [“geckoViewAddons”, “nativeMessagingFromContent”], be one of [“contextualIdentities”], be one of [“dns”], be one of [“activityLog”], be one of [“networkStatus”], be one of [“telemetry”], or be one of [“theme”]], must either [must either [be one of [“idle”], be one of [“activeTab”], be one of [“cookies”], or be one of [“webRequest”, “webRequestBlocking”]], be one of [“clipboardRead”, “clipboardWrite”, “geolocation”, “notifications”], be one of [“browsingData”], be one of [“tabs”], be one of [“browserSettings”], be one of [“downloads”, “downloads.open”], be one of [“management”], be one of [“privacy”], be one of [“proxy”], be one of [“nativeMessaging”], or be one of [“webNavigation”]], or match the pattern /^experiments(.\w+)+$/], or must either [be one of [“<all_urls>”], must either [match the pattern /^(https?|wss?|file|ftp|*)://(*|*.[^/]+|[^/]+)/.$/, or match the pattern /^file:///.$/], or match the pattern /^resource://(*|*.[^/]+|[^/]+)/.*$|^about:/]

Is there really no way to make an extension with bookmarks permission on Firefox mobile? That seems like a really big oversight if something this simple can’t be implemented.

I found the button for my addon, and was able to get the page to load at all… but not read any bookmarks. I’m now getting:

Uncaught TypeError: can’t access property “getTree”, browser.bookmarks is undefined

This is referencing my code based on this API, where I try to run:

var bookmarkTree = browser.bookmarks.getTree();
bookmarkTree.then(bookmarkFillerRoot, onError);

bookmarkFillerRoot is a function that will create the html of the bookmarks, but it’s not run.

Yes, I see that Firefox for Android doesn’t support the bookmarks API. My point is that it should as bookmarks have nothing to do with the underlying operating system or device and should be the exact same code on desktop, (where they work) and mobile, (where they SHOULD work, but don’t.)

Would it be possible to port the bookmarks API from the desktop code into the mobile nightly build?

Probably not since the backend storing the actual bookmarks is completely different. It would likely require a separate implementation specific to Firefox for Android’s bookmark backend.