Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/options.js

Issue 29597555: Issue 5977 - Set popup programmatically on Firefox (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Revert changes to polyfill.js Created Nov. 6, 2017, 2:16 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | metadata.gecko » ('j') | metadata.gecko » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 (info.application == "firefox")
+{
+ browser.browserAction.setPopup({popup: "popup.html"});
+}
+else if (info.platform == "gecko")
+{
+ browser.runtime.getBrowserInfo().then(browserInfo =>
+ {
+ if (browserInfo.name != "Fennec")
+ browser.browserAction.setPopup({popup: "popup.html"});
+ });
+}
Wladimir Palant 2017/11/06 15:04:31 If we are choosing that approach, I wonder whether
Manish Jethani 2017/11/13 10:42:13 I was hoping to restrict this to Gecko only to avo
+
// 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);
« no previous file with comments | « no previous file | metadata.gecko » ('j') | metadata.gecko » ('J')

Powered by Google App Engine
This is Rietveld