I'm trying to update my Chrome extension both to make it compatible with Manifest v.3 and to use a service worker and my own DevTools panel.
I declare both the service worker script and my DevTools panel page in manifest.json
:
"background": { "service_worker": "myextension.js" },
"devtools_page": "devtools.myextension.html"
The Devtools panel page devtools.myextension.html
contains the single line:
<script src="devtools.myextension.js"></script>
Script devtools.myextension.js
contains the code:
chrome.devtools.panels.create(
"My Extension",
"myextension.png",
"panel.devtools.myextension.html",
panel => {
console.log("devtools.myextension.js");
}
);
Service worker script myextension.js
starts with the line:
console.log("myextension.js");
As it was advised here and here I open the DevTools for the service worker in a separate window, then find the tab with my DevTools panel (it is created successfully), and then open another DevTools on the DevTools panel in another separate window. I can see both scripts mentioned above somewhere in the opened panels, I can see their logs in console(s), I can even mark some lines in those scripts as breakpoints.
The problem is those breakpoints never work. Is there a way to debug the code here normally rather than just to wait for error messages after its corrections?