chrome-extension/js/background.js
function setRecorderWork(enable){
    isWorking = enable;
    if(isWorking){
        chrome.browserAction.setTitle({title: __('icon_record_tip')});
        chrome.browserAction.setIcon({path: workIcon===1?ENABLE_ICON1:ENABLE_ICON2});
        workIcon *= -1;
        workIconTimer = setTimeout(function(){
            setRecorderWork(true);
        }, 1000);
    }
    else{
        clearTimeout(workIconTimer);
        chrome.browserAction.setTitle({title: __('icon_end_tip')});
        chrome.browserAction.setIcon({path: DISABLE_ICON});
    }
}
function setRecorderWork(enable){
    isWorking = enable;
    if(isWorking){
        chrome.browserAction.setTitle({title: __('icon_record_tip')});
        chrome.browserAction.setIcon({path: workIcon===1?ENABLE_ICON1:ENABLE_ICON2});
        workIcon *= -1;
        workIconTimer = setTimeout(function(){
            setRecorderWork(true);
        }, 1000);
    }
    else{
        clearTimeout(workIconTimer);
        chrome.browserAction.setTitle({title: __('icon_end_tip')});
        chrome.browserAction.setIcon({path: DISABLE_ICON});
    }
}
function setRecorderWork ( enable ) { isWorking = enable ; if ( isWorking ) { chrome . browserAction . setTitle ( { title : __ ( 'icon_record_tip' ) } ) ; chrome . browserAction . setIcon ( { path : workIcon === 1 ? ENABLE_ICON1 : ENABLE_ICON2 } ) ; workIcon *= - 1 ; workIconTimer = setTimeout ( function ( ) { setRecorderWork ( true ) ; } , 1000 ) ; } else { clearTimeout ( workIconTimer ) ; chrome . browserAction . setTitle ( { title : __ ( 'icon_end_tip' ) } ) ; chrome . browserAction . setIcon ( { path : DISABLE_ICON } ) ; } }
set recorder work status
set recorder work status