简体   繁体   中英

firebug: breakpoints and contentEditable odd behaviour

I have a contentEditable element (a tinyMCE editor, actually); I'm debugging my plugin, looking for a bug specific to Firefox.

My code uses event listeners to work, with:

ed.onKeyDown.addToTop(mycallback);

Now, my problem is that, if I put a breakpoint in a line of code that is fired by the pressing of a key, and then click on firebug's "continue" button, the code continues, but the key is discarded by the editor. That is, I press a key and it doesn't appear in the editor. If I remove the breakpoint, the editor works fine.

This only happens on firefox: Google Chrome works fine.

Is there a solution to use breakpoints and still see the editor work?

I don't know if you're still having this problem, but it's working fine for me using the follow example with Firefox 13.0.1 + Firebug 1.9.2 on Win7:

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>tinyMCE test</title>
        <script type="text/javascript" src="tiny_mce/tiny_mce.js"></script>
        <script type="text/javascript">
        function mycallback() {
          console.log("Key down");
        }

        var ed = new tinymce.Editor("editor", {});

        ed.onKeyDown.addToTop(mycallback);

        ed.render();
        </script>
    </head>
    <body>
        <textarea id="editor">test</textarea>
    </body>
</html>

My steps:

  1. Opened Firebug on that test page
  2. Enabled and switched to the Script panel
  3. Reloaded the page
  4. Set a breakpoint at line 10 ( console.log("Key down"); )
  5. Typed 'a' into the tinyMCE editor => Execution stopped at line 10
  6. Clicked the Continue button
  7. Switched to the Console panel

=> Output "Key down" was logged into the Console panel

I have to admit that I don't know anything about tinyMCE and your description was not 100% clear to me. If you still have that problem, it will help, if you give a small test case including steps to reproduce like I did.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM