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

Unified Diff: ext/background.js

Issue 29527610: Noissue - Add version check for runtime.openOptionsPage for Firefox for Android (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Update comment Created Aug. 25, 2017, 9:30 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ext/background.js
===================================================================
--- a/ext/background.js
+++ b/ext/background.js
@@ -694,21 +694,25 @@
},
onChanged: chrome.storage.onChanged
};
/* Options */
ext.showOptions = callback =>
{
+ let info = require("info");
+
if ("openOptionsPage" in chrome.runtime &&
- // Firefox for Android does have a runtime.openOptionsPage but it
- // doesn't do anything.
+ // Some versions of Firefox for Android before version 57 do have a
+ // runtime.openOptionsPage but it doesn't do anything.
// https://bugzilla.mozilla.org/show_bug.cgi?id=1364945
- require("info").application != "fennec")
+ (info.application != "fennec" ||
+ (parseInt(info.applicationVersion, 10) >= 57 &&
+ info.applicationVersion != "57.0a1")))
Wladimir Palant 2017/08/25 09:56:46 It should be sufficient to check that it's Firefox
Manish Jethani 2017/08/25 11:02:31 Done.
{
if (!callback)
{
chrome.runtime.openOptionsPage();
}
else
{
chrome.runtime.openOptionsPage(() =>
@@ -727,17 +731,17 @@
}
});
});
}
}
else
{
// Edge does not yet support runtime.openOptionsPage (tested version 38)
- // nor does Firefox for Android,
+ // nor does Firefox for Android before version 57,
// and so this workaround needs to stay for now.
// We are not using extension.getURL to get the absolute path here
// because of the Edge issue:
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10276332/
let open = win =>
{
let optionsUrl = "options.html";
let queryInfo = {url: optionsUrl};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld