Index: dependencies
===================================================================
--- a/dependencies
+++ b/dependencies
@@ -1,5 +1,5 @@
 _root = hg:https://hg.adblockplus.org/ git:https://github.com/adblockplus/
 _self = buildtools/ensure_dependencies.py
-buildtools = buildtools hg:014321e2dfa3 git:6b014d0
+buildtools = buildtools hg:1c798cc8b402 git:9643c00
 adblockpluscore = adblockpluscore hg:000df4267bc8 git:563b247
 adblockplusui = adblockplusui hg:eae92061c9a1 git:5bf6edb
Index: lib/options.js
===================================================================
--- a/lib/options.js
+++ b/lib/options.js
@@ -119,16 +119,35 @@
       browser.tabs.create({url: optionsUrl}, () =>
       {
         returnShowOptionsCall(optionsTab, callback);
       });
     }
   });
 };
 
+// We need to clear the popup URL on Firefox for Android in order for the
+// options page to open instead of the bubble. Unfortunately there's a bug[1]
+// which prevents us from doing that, so we must avoid setting the URL on
+// Firefox from the manifest at all, instead setting it here only for
+// non-mobile.
+// [1] - https://bugzilla.mozilla.org/show_bug.cgi?id=1414613
+if ("getBrowserInfo" in browser.runtime)
+{
+  browser.runtime.getBrowserInfo().then(browserInfo =>
+  {
+    if (browserInfo.name != "Fennec")
+      browser.browserAction.setPopup({popup: "popup.html"});
+  });
+}
+else
+{
+  browser.browserAction.setPopup({popup: "popup.html"});
+}
+
 // On Firefox for Android, open the options page directly when the browser
 // action is clicked.
 browser.browserAction.onClicked.addListener(() =>
 {
   browser.tabs.query({active: true, lastFocusedWindow: true}, ([tab]) =>
   {
     let currentPage = new ext.Page(tab);
 
Index: metadata.gecko
===================================================================
--- a/metadata.gecko
+++ b/metadata.gecko
@@ -1,14 +1,15 @@
 [default]
 inherit = metadata.chrome
 
 [general]
 id={d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}
 basename = adblockplusfirefox
+browserAction -= popup.html
 
 [compat]
 gecko = 50.0
 
 [mapping]
 mobile-options.html = adblockplusui/mobile-options.html
 mobile-options.js = adblockplusui/mobile-options.js
 desktop-options.html = adblockplusui/desktop-options.html
Index: polyfill.js
===================================================================
--- a/polyfill.js
+++ b/polyfill.js
@@ -18,16 +18,17 @@
 "use strict";
 
 {
   const asyncAPIs = [
     "contextMenus.removeAll",
     "devtools.panels.create",
     "notifications.clear",
     "notifications.create",
+    "runtime.getBrowserInfo",
     "runtime.openOptionsPage",
     "runtime.sendMessage",
     "runtime.setUninstallURL",
     "storage.local.get",
     "storage.local.remove",
     "storage.local.set",
     "storage.managed.get",
     "tabs.create",
