code: function saveCommand(cmd, data){
          var frameId = getFrameId();
          var cmdData = {
              frame: frameId,
              cmd: cmd,
              data: data
          };
          if(/^!/.test(frameId)){
              parent.postMessage({
                  type: 'uiRecorderFrameCommmand',
                  data: cmdData
              }, '*');
          }
          else{
              chrome.runtime.sendMessage({
                  type: 'command',
                  data: cmdData
              });
              if(lastAlertExpect && cmdData.cmd === lastAlertExpect.params[0]){
                  lastAlertExpect.params = [];
                  chrome.runtime.sendMessage({
                      type: 'command',
                      data: {
                          cmd: 'expect',
                          frame: frameId,
                          data: lastAlertExpect
                      }
                  });
                  lastAlertExpect = null;
              }
          }
      }
docs: save command