(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #1)
Luca, should we just use 'policy.name' instead of 'policy.id' on this line:
...or could DevTools get extension name from ID using an API?
yes, we could as well turn the extension id into a name from network-observer.js using something like:
const extensionPolicy = WebExtensionPolicy.getByID(extID);
const extName = extensionPolicy.name;
we are already doing something similar for the debugger panel in devtools/server/actors/source.js here (but to get the extension name from the moz-extension url in that case).
If we resort to this, it may be reasonable to use a
WeakMap<WebExtensionPolicy -> string> to avoid doing that for every single blocked resource.
One caveat in doing that from network-observer.js is that in the global of the devtools modules the WebExtensionPolicy global isn't available by default like in jsm modules, and so we would have to retrieve it explicitly using something like
Cu.getGlobalForObject(Cu).WebExtensionPolicy, like we are doing in the devtools/server/actors/source.js here.
I'm needinfo Shane, to hear his opinion, e.g. if he would actually prefer to do that in WebRequest.jsm.