Luca, in webExtensionTargetPrototype._shouldAddNewGlobalAsDebuggee we have:
ChromeUtils.getClassName(global.document) == "XULDocument"
But as we convert more chrome documents to HTML (i.e. browser.xhtml instead of browser.xul) this check won't work anymore. AFAICT this function will still end up returning false in this case due to this.isExtensionWindowDescendent(global.document.ownerGlobal) later on for these documents, but I'm wondering if we should either remove the "XULDocument" check or change it to check for system principal. I'm not sure if there are gotchas with doing the latter (like, extension windows that are also system principal). Do you have an opinion on what to do here?
I've been trying to remember if there were any other reasons for that check, but from what I recall it was meant to just exit earlier (without further checks) on a global related to a XUL document.
As you pointed out there are also the two checks that follows it which are still going to filter out any of those documents, and so it seems to me that we could just remove the explicit check for the XUL documents.