Optimize browser type logic.

This commit is contained in:
Kenshin 2018-03-23 14:00:44 +08:00
parent 1d3bdef06f
commit fd775c924f
2 changed files with 2 additions and 2 deletions

View File

@ -579,7 +579,7 @@ class Storage {
callback && callback();
});
} else {
if ( br.type == "firefox" && window.location.protocol != "moz-extension:" ) {
if ( br.isFirefox() && window.location.protocol != "moz-extension:" ) {
callback && callback();
} else {
browser.storage.local.get( ["secret"], result => {

View File

@ -65,7 +65,7 @@ function lock( url ) {
* @param {fucntion} callback watch.Lock() state, result
*/
function verify( callback ) {
br.type == "chrome" ?
!br.isFirefox() ?
browser.runtime.sendMessage( msg.Add( msg.MESSAGE_ACTION.save_verify, { url: window.location.href }), result => {
callback( result.site || result.import || result.version || result.option, result );
}) : callback( false );