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: Use "" instead of null for compatiblity with older Firefox versions Created May 15, 2018, 2:19 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') | 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,8 @@
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;
function findOptionsTab(callback)
{
@@ -186,14 +187,10 @@
{
browser.runtime.getBrowserInfo().then(browserInfo =>
{
- if (browserInfo.name != "Fennec")
- browser.browserAction.setPopup({popup: "popup.html"});
+ if (browserInfo.name == "Fennec")
+ browser.browserAction.setPopup({popup: ""});
});
}
-else
-{
- browser.browserAction.setPopup({popup: "popup.html"});
-}
// On Firefox for Android, open the options page directly when the browser
// action is clicked.
« no previous file with comments | « no previous file | metadata.gecko » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld