Commit 8ae42994 authored by sajolida's avatar sajolida
Browse files

Fix Chromium detection

parent a362d180
(function() {
var chromeSupported = !/\bchrome-unsupported\b/.test((document.getElementById("download-and-verify") || document.documentElement).className);
var chromeSupported = false;
var minVer = {
"firefox": 38,
"chome": 44,
"chrome": 44,
"tor": 5
};
......@@ -22,7 +22,10 @@
v = navigator.userAgent.match(/\b(Chrome|Firefox)\/(\d+)/)
;
v = v && parseInt(v[2]) || 0;
if (window.InstallTrigger) {
var override = location.search.match(/\boverride=(\w+)/);
if (override) {
browser = override[1];
} else if (window.InstallTrigger) {
if (v >= minVer.firefox || minVer.firefox === 38 && new RegExp("").source) // see Fx 38 RegExp @ https://developer.mozilla.org/it/Firefox/Releases/38
browser = "firefox";
else {
......@@ -33,7 +36,7 @@
}, true);
}
} else {
forId("unsupported-firefox", function(el) { el.style.display = "none"; });
addEventListener("DOMContentLoaded", function() { forId("unsupported-firefox", function(el) { el.style.display = "none"; }); }, true);
if (chromeSupported &&
/\bChrom/.test(navigator.userAgent) && /\bGoogle Inc\./.test(navigator.vendor) &&
v >= minVer.chrome) {
......
......@@ -15,8 +15,8 @@ two techniques to do this verification automatically.</p>
<p>Please wait…</p>
</div>
<div id="download-and-verify">
<div id="extension-version">0.2.7rc1</div>
<div id="download-and-verify" class="chrome-unsupported">
<div id="extension-version">0.2.7rc60</div>
<div id="undetected-browser">
<p>We failed to detect your browser vendor, maybe because JavaScript is disabled.</p>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment