'Connecting an external debugger for browser extension development

I'm trying to figure out how to properly attach an external debugger from, say WebStorm or vs-code to debug a browser extension.

How my ideal workflow would look like:
I launch an extension in dev-mode with https://github.com/mozilla/web-ext and then can attach debugger to that browser instance, see break-points/etc.

What I've tried

Expected: debugger stops at a break point
Actual: page loads without interruption (or sometimes debugger stops at a random code not from my extension 😅 )

I've also tried setting the breakpoint for a background script, which didn't seem to have any effect either.


Misc

  • For content-script WebStorm seems to indicate that break-points are not in a valid state enter image description here
  • Background script breakpoint is, not that it helps enter image description here
  • Code is bundled with Parcel with source-maps enabled
  • Browser is Chrome 99.0.4844.51 (FF debugging does not seem to be supported)
  • System: macOS 12.2


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source