code: function setOPBrowserState (event) {
      var key = 'anvil.connect.op.state'
      var current = localStorage[key]
      var update = event.data
  
      if (current !== update) {
        document.cookie = 'anvil.connect.op.state=' + update
        localStorage['anvil.connect.op.state'] = update
      }
    }
docs: Set browser state