I’ve been spending some time modifying Firefox for Android.
I want to disable the “Add-ons” feature but I’ve been unable to do so. It might be because this feature is being loaded from Firefox Components.
How do you disable or hide the Add-ons feature?
Here is a screenshot of the Add-ons menu option
LXdmq3R.png (580×1212) (imgur.com)
1 Like
pocmo
May 25, 2021, 8:06am
2
Hey!
Fenix is using WebExtensionBrowserMenuBuilder
in DefaultToolbarMenu
. This class is responsible for adding the add-on manager entry and entries that add-ons want to add to the menu.
private var isBookmarkedJob: Job? = null
private val shouldDeleteDataOnQuit = context.settings().shouldDeleteBrowsingDataOnQuit
private val shouldUseBottomToolbar = context.settings().shouldUseBottomToolbar
private val accountManager = FenixAccountManager(context)
private val selectedSession: TabSessionState?
get() = store.state.selectedTab
override val menuBuilder by lazy {
WebExtensionBrowserMenuBuilder(
items =
if (FeatureFlags.toolbarMenuFeature) {
newCoreMenuItems
} else {
oldCoreMenuItems
},
endOfMenuAlwaysVisible = shouldUseBottomToolbar,
store = store,
style = WebExtensionBrowserMenuBuilder.Style(
webExtIconTintColorResource = primaryTextColor(),
If you replace it with a plain BrowserMenuBuilder
and make the necessary changes then those menu entries should no longer show up.
You may also want to check that add-ons, like the webcompat reporter, are not added since they are trying to add something to the menu.
).also {
WebCompatFeature.install(it)
/**
* There are some issues around localization to be resolved, as well as questions around
* the capacity of the WebCompat team, so the "Report site issue" feature should stay
* disabled in Fenix Release builds for now.
* This is consistent with both Fennec and Firefox Desktop.
*/
if (Config.channel.isNightlyOrDebug || Config.channel.isBeta) {
WebCompatReporterFeature.install(it, "fenix")
}
}
}
/**
* Passed to [engine] to intercept requests for app links,
* and various features triggered by page load requests.
*
* NB: This does not need to be lazy as it is initialized
* with the engine on startup.
1 Like
Hi pocmo,
Thank you! This is very helpful.
How do you remove the Add-ons option from the long main menu in addition to the short default menu?
Here is a screenshot of the other Add-ons option in the menu I’m referring to
Z5LHJ7Z.png (288×602) (imgur.com)
@pocmo any ideas? I really appreciate your help!
@pocmo for your help figuring this out I’ll send you a tip on PayPal or CashApp. I really appreciate your help!
pocmo
May 28, 2021, 11:25am
6
for your help figuring this out I’ll send you a tip on PayPal or CashApp.
That’s not needed. But thank you!
How do you remove the Add-ons option from the long main menu in addition to the short default menu?
There are two places to remove the menu option, from the home screen and from the browser screen.
HomeFragment
/HomeMenu
: Here the menu item is added to the home screen.
DefaultToolbarMenu
: Here the WebExtensionBrowserMenuBuilder
will add the addon-manager menu item and menu items for add-ons.
You can remove both with a change like this:
committed 11:24AM - 28 May 21 UTC
2 Likes