mirror of
https://github.com/Kenshin/simpread.git
synced 2026-01-25 14:28:34 +00:00
Optimize browser type logic.
This commit is contained in:
parent
1d3bdef06f
commit
fd775c924f
@ -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 => {
|
||||
|
||||
@ -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 );
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user