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}; |