   (let (cmd js-file)
     (setq js-file (read-file-name "js file:" moz-repl-js-dir))
     (when (file-exists-p js-file)
+      ;; flush mozrepl at first
+      (moz-goto-content-and-run-cmd "console.log('hello');")
       ;; read the content of js-file
       (setq cmd (moz--read-file js-file))
       (moz-goto-content-and-run-cmd cmd))

                     (lambda ()
                       (interactive)
                       (comint-send-string (inferior-moz-process)
                                           "BrowserReload();")))
     ))

(defun auto-reload-firefox-on-after-save-hook ()

            '(lambda ()
               (interactive)
               (comint-send-string (inferior-moz-process)
                                   "setTimeout(function(){content.document.location.reload(true);}, '500');"))
            'append 'local)) ;; buffer-local

(defun moz-goto-content-and-run-cmd (cmd)
  (comint-send-string (inferior-moz-process)
                      (concat "repl.enter(content);"
                              cmd
