popup/ruler_popup.js
/**
* Stores settings for the current tab to the 
* browser local storage
*/
Stores settings for the current tab to the
browser local storage
Stores settings for the current tab to the browser local storage
function storeSettings() {
  if (!currentTab) {
    throw "Cannot determine tab id while storing settings!";
  }
  if (!optionsElm.state.checked && !optionsElm.bsbState.checked) {
    enabledTabs.delete(currentTab);
  } else {
    enabledTabs.set(currentTab, { 
      state: optionsElm.state.checked,
      bsbState: optionsElm.bsbState.checked
    });
  }
  browser.storage.local.set({ tabs: enabledTabs });
}
function storeSettings ( ) { if ( ! currentTab ) { throw "Cannot determine tab id while storing settings!" ; } if ( ! optionsElm . state . checked && ! optionsElm . bsbState . checked ) { enabledTabs . delete ( currentTab ) ; } else { enabledTabs . set ( currentTab , { state : optionsElm . state . checked , bsbState : optionsElm . bsbState . checked } ) ; } browser . storage . local . set ( { tabs : enabledTabs } ) ; }
Stores settings for the current tab to the
browser local storage
Stores settings for the current tab to the browser local storage
// Neither setting is checked, let's delete current tab from Map