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

Unified Diff: lib/options.js

Issue 29782593: Noissue - Don't hard-code options and popup URL (Closed)
Patch Set: Created May 15, 2018, 1:22 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/options.js
===================================================================
--- a/lib/options.js
+++ b/lib/options.js
@@ -22,7 +22,9 @@
const {checkWhitelisted} = require("./whitelisting");
const info = require("../buildtools/info");
-const optionsUrl = "options.html";
+const manifest = browser.runtime.getManifest();
+const optionsUrl = manifest.options_page || manifest.options_ui.page;
kzar 2018/05/15 13:32:31 I trust you got it right, but i wonder where manif
Sebastian Noack 2018/05/15 14:17:15 That is correct, but there is also Microsoft Edge
+const popupUrl = manifest.browser_action.default_popup;
kzar 2018/05/15 13:32:31 I don't see this one for gecko.
Sebastian Noack 2018/05/15 14:17:15 Argh, right. We removed the popup URL from the man
function findOptionsTab(callback)
{
@@ -187,12 +189,12 @@
browser.runtime.getBrowserInfo().then(browserInfo =>
{
if (browserInfo.name != "Fennec")
- browser.browserAction.setPopup({popup: "popup.html"});
+ browser.browserAction.setPopup({popup: popupUrl});
});
}
else
{
- browser.browserAction.setPopup({popup: "popup.html"});
+ browser.browserAction.setPopup({popup: popupUrl});
}
// On Firefox for Android, open the options page directly when the browser
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld