vendredi 26 décembre 2014

Detect if Chrome debugger is running from React plugin handler


This is a rather strange situation, as it doesn't show up with typical Chrome dev workflow, and maybe it can really only be answered when we know about the inner workings of the React Chrome plugin (or of Chrome, of course).


Basically what I'm experiencing is some breakage whenever I have Chrome in a debugger breakpoint paused state, and update my source code. This causes the React plugin to actually run, but when it hot-swaps the code (which I want to use most of the time), it places the entire tab into a bad state that persists after I refresh the page.


Needless to say the workaround is to simply not leave the Chrome debugger paused and edit code, but I think you can understand how easy it is to do this because when I find a reason to fix the code during a debug session it is very hard to remember to do something potentially destructive like unpausing the debugger.


Now i have some ideas about where to try to dig in the react plugin code to try to make sense of this, but I can't really afford to do that, either.


Basically I have to find out whether Chrome is currently paused in the debugger, and if it is, I have to prevent the hot-swap from proceeding. Is there a way to do this?





Aucun commentaire:

Enregistrer un commentaire