firefox-devtools / vscode-firefox-debug

VS Code Debug Adapter for Firefox
https://marketplace.visualstudio.com/items?itemName=firefox-devtools.vscode-firefox-debug
MIT License
398 stars 67 forks source link

Sometimes freezes Firefox when in about:addons #86

Open rugk opened 6 years ago

rugk commented 6 years ago

I am testing it out with Firefox Developer Editition for debugging my add-on.

So when I am in about:add-ons it often freezes Firefox. Also, it ignores my breajkpoint.

STR:

  1. Debug add-on.
  2. Set breakpoint somewhere in code that is to be called in the settings.
  3. Go to settings page of add-on. -> First issue: Breakpoint does not trigger, but is just ignored.
  4. Press F5 in the browser to reload the options page OR click on "extensions" on the left to get to the overview. -> Freezes.

Firefox log:

JavaScript warning: resource://devtools/shared/base-loader.js -> resource://devtools/server/actors/inspector/walker.js, line 1612: DebuggeeWouldRun: debuggee `self-hosted:582' would run
JavaScript warning: resource://devtools/shared/base-loader.js -> resource://devtools/server/actors/inspector/walker.js, line 1612: DebuggeeWouldRun: debuggee `self-hosted:582' would run
JavaScript warning: resource://devtools/shared/base-loader.js -> resource://devtools/server/actors/utils/event-loop.js, line 118: DebuggeeWouldRun: debuggee `chrome://global/content/bindings/general.xml:15' would run

Firefox 62

hbenl commented 6 years ago

The breakpoint not being hit when the code runs for the first time is a known weakness of the debug protocol. There are two workarounds:

As for the reloading bug: I could reproduce it, but the behavior seems very sporadic and I'm not sure what the issue really is and if I can fix it. I'll keep trying though (when I find the time). One observation: It seemed to happen less frequently when I added "sourceMaps": "client" to the configuration. That seems weird, since you're not using sourcemaps, but it's not entirely impossible. On the other hand the sporadic behavior makes diagnosing and narrowing down this bug very difficult, so maybe this was just coincidence.