Show user-facing addon name instead of guid for blocked requests
Categories
(DevTools :: Netmonitor, enhancement, P3)
Tracking
(firefox78 fixed)
Tracking | Status | |
---|---|---|
firefox78 | --- | fixed |
People
(Reporter: Harald, Assigned: Honza)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Right now addons are displayed using the internal guid, but we should show the user-facing addon name from the manifest.
Instead of showing "uBlock0@raymondhill.net" it should be "uBlock Origin"
Reporter | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Luca, should we just use 'policy.name' instead of 'policy.id' on this line:
https://searchfox.org/mozilla-central/rev/09b8072a543c145de2dc9bb76eddddd4a6c09adc/toolkit/components/extensions/webrequest/WebRequest.jsm#928
...or could DevTools get extension name from ID using an API?
Honza
Comment 2•5 years ago
|
||
(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:
https://searchfox.org/mozilla-central/rev/09b8072a543c145de2dc9bb76eddddd4a6c09adc/toolkit/components/extensions/webrequest/WebRequest.jsm#928...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.
Comment 3•5 years ago
|
||
The extension ID was used here specifically because if more extension info was desired, you would not be able to get to it (100% reliably) from the extension name. As Luca described, you can use the policy to get what you need.
Assignee | ||
Comment 4•5 years ago
|
||
Updated•5 years ago
|
Comment 6•5 years ago
|
||
bugherder |
Description
•