Firefox 如何从Emacs在浏览器中设置javascript断点?

Firefox 如何从Emacs在浏览器中设置javascript断点?,firefox,google-chrome,emacs,automation,Firefox,Google Chrome,Emacs,Automation,作为一名JS开发人员,我希望按下JS文件中某行上的一个键,并在浏览器的调试器中设置调试断点。对于额外的积分,找到这一行的方法应该是“模糊”的,因为我的构建系统可能会在当前文件前面加上其他JS 我知道slime js在页面js中与之对话,但我正在寻找与Firebug或Chrome“开发者工具”的连接。这就是我在.emacs中的内容 (defun line-matches-p (regexp) (string-match-p regexp (buffer-substring

作为一名JS开发人员,我希望按下JS文件中某行上的一个键,并在浏览器的调试器中设置调试断点。对于额外的积分,找到这一行的方法应该是“模糊”的,因为我的构建系统可能会在当前文件前面加上其他JS


我知道slime js在页面js中与之对话,但我正在寻找与Firebug或Chrome“开发者工具”的连接。

这就是我在.emacs中的内容

(defun line-matches-p (regexp)
  (string-match-p
   regexp
   (buffer-substring
    (line-beginning-position)
    (line-end-position))))

(defun js-toggle-debugger ()
  (interactive)
  (if (line-matches-p "debugger")
      (delete-region (line-beginning-position)
                     (1+ (line-end-position)))
      (progn (beginning-of-line)
             (insert "\n")
             (backward-char)
             (insert "debugger;")
             (indent-according-to-mode)
             (end-of-line))))
它插入或删除“调试器”关键字。我用过firebug和moz repl


缺点是需要您重新评估函数。

谢谢您的回答。但是,当浏览器调试器现在非常擅长管理断点时,这就是为什么我想将其推迟到浏览器。我还试图避免重新加载页面。它应该如何确定与哪个浏览器选项卡/实例对话?我认为您需要一个特定的选项卡,在您希望操作它的时候绑定到Emacs?