src/options.js
/**
 * Saves checked and uncheck values to synchronized storage.
 */
Saves checked and uncheck values to synchronized storage.
Saves checked and uncheck values to synchronized storage .
function formSave () {
  const checkboxes = document.getElementsByTagName('input')
  const services = []
  for (let i = 0; i < checkboxes.length; i++) {
    if (checkboxes[i].checked === true) {
      services.push(checkboxes[i].name)
    }
  }
  chrome.storage.sync.set({ memberships: services })
  chrome.runtime.sendMessage({ getDiscounts: true })
}
function formSave ( ) { const checkboxes = document . getElementsByTagName ( 'input' ) const services = [ ] for ( let i = 0 ; i < checkboxes . length ; i ++ ) { if ( checkboxes [ i ] . checked === true ) { services . push ( checkboxes [ i ] . name ) } } chrome . storage . sync . set ( { memberships : services } ) chrome . runtime . sendMessage ( { getDiscounts : true } ) }
Saves checked and uncheck values to synchronized storage.
Saves checked and uncheck values to synchronized storage .
// Loop through all checked checkboxes