2017-10-02 23:30:40 +02:00
|
|
|
var _bd_usebrowser = "firefox";
|
|
|
|
|
2018-01-17 20:57:24 +01:00
|
|
|
var _bd_isFirefox = false;
|
|
|
|
var _bd_isChrome = false;
|
|
|
|
var _bd_isEdge = true; // we'll see if FF
|
|
|
|
|
|
|
|
try{
|
|
|
|
// this will fail in Edge
|
|
|
|
|
|
|
|
var promise = browser.runtime.getBrowserInfo();
|
|
|
|
_bd_isFirefox = true;
|
|
|
|
_bd_isEdge = false;
|
|
|
|
}
|
|
|
|
catch (e) {};
|
|
|
|
|
|
|
|
if(typeof browser === "undefined"){ // This is a good sign we're in chrome or chromium-based browsers
|
2017-10-02 23:30:40 +02:00
|
|
|
if(chrome){
|
|
|
|
browser = chrome;
|
2018-01-17 20:57:24 +01:00
|
|
|
_bd_usebrowser = "chrome;
|
|
|
|
_bd_isChrome = true;
|
|
|
|
_bd_isEdge = false;
|
2017-10-02 23:30:40 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var BrowserDetect = {
|
2018-01-17 20:57:24 +01:00
|
|
|
usebrowser: _bd_usebrowser,
|
|
|
|
firefox: _bd_isFirefox,
|
|
|
|
chrome: _bd_isChrome,
|
|
|
|
edge: _bd_isEdge
|
2017-10-02 23:30:40 +02:00
|
|
|
}
|