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: Created Nov. 4, 2017, 11:22 a.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,27 @@
browser.tabs.create({url: optionsUrl}, () =>
{
returnShowOptionsCall(optionsTab, callback);
});
}
});
};
+// On Firefox we set the popup programmatically here rather than via
+// manifest.json so we can open the options page directly on Android.
+if ("getPopup" in browser.browserAction)
kzar 2017/11/04 16:17:26 The idea is that browser.browserAction.getPopup do
Wladimir Palant 2017/11/04 19:43:26 I think that the idea is rather introducing a dela
Manish Jethani 2017/11/05 11:35:00 The idea was that popup.html is set in manifest.js
Manish Jethani 2017/11/05 11:35:00 getPopup does exist on Firefox for Android v57, bu
kzar 2017/11/06 09:36:51 Right gotya.
+{
+ browser.browserAction.getPopup({}).then(url =>
+ {
+ if (!url && info.application != "fennec")
Manish Jethani 2017/11/04 11:27:17 Note that we can't check for "fennec" in the initi
Wladimir Palant 2017/11/04 19:43:26 Can't we call getBrowserInfo explicitly here then?
kzar 2017/11/04 21:50:31 Oh yea, cool idea. By clearing the popup URL for F
Manish Jethani 2017/11/05 11:35:00 This does not work unfortunately due to a bug that
kzar 2017/11/06 09:36:51 Damn, that sucks. I guess we could at least get ri
Manish Jethani 2017/11/06 14:15:09 Done.
+ 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);
« no previous file with comments | « no previous file | metadata.gecko » ('j') | metadata.gecko » ('J')

Powered by Google App Engine
This is Rietveld