Performance tab "Not supported for current toolbox target" when debugging WebExtensions
Categories
(DevTools :: Performance Tools (Profiler/Timeline), defect, P3)
Tracking
(Not tracked)
People
(Reporter: ainar-g, Unassigned)
References
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0
Steps to reproduce:
What I'm trying to do: debug some performance issues of a WebExtension.
What I'm doing:
-
Go to about:debugging.
-
Go to “This Firefox”.
-
Choose any extension and press “Inspect”.
Actual results:
Еhe Performance tab isn't available. Opening the DevTools Settings I see that the “Performance” checkbox in the “Default Developer Tools” is greyed out, and below there is the text:
*Not supported for current toolbox target
Expected results:
I expected the “Performance” tab to be available.
My colleagues say that this wasn't the case in the older versions. I've tried on 91.8.0esr (OpenBSD), 99, and 100 beta (both on Ubuntu Linux), and it's greyed out on all of these.
Comment 1•4 years ago
•
|
||
Thanks for the report! We'll look at better supporting this use case. Maybe Alexandre will have an idea as he worked a bit on the remote toolbox recently.
In the meantime, I believe you can debug the Web Extension directly using the popup:
- Go to profiler.firefox.com to enable the new popup.
- Use the popup to start the profiler.
- Run your scenario.
- Use the popup to stop the profiler and capture the profile.
I hope this helps!
| Reporter | ||
Comment 2•4 years ago
|
||
Thanks for the quick response! Unfortunately, that profiler doesn't seem to work for me at all, at least on 100.0b9. When I start recording, CPU utilization reaches 100 % and the browser becomes unresponsive.
Comment 3•4 years ago
|
||
Interesting... If you're using ubuntu, this might be bug 1759196 that should be fixed on beta soon, but you can try Nightly for now where the bug is fixed.
Otherwise, could you please file another bug with more information about this other issue?
| Reporter | ||
Comment 4•4 years ago
|
||
Yes, that bug seems to be the same that I'm having, so I guess I'll wait for 101 to enter beta.
Comment 5•4 years ago
|
||
Hey Ainar,
v101 should enter beta today (I'm not sure when a new build will be available). I'm interested to know if you can move forward with your work once this is available.
Also v100 will have the fix in release (releasing tomorrow), but the fix landed too late to be in the last v100 beta.
Updated•4 years ago
|
| Reporter | ||
Comment 6•4 years ago
|
||
Hey Julien!
Yes, the new profiler works for me in 101 b.2. Thanks for the suggestion to use it!
Comment 7•4 years ago
|
||
That's good to hear!
Let's wait and see what Alexandre thinks about supporting the webextension use case better.
Comment 8•4 years ago
|
||
Here we don't disable the profiler because it is remote, but solely because it isn't a local tab, nor the browser toolbox:
https://searchfox.org/mozilla-central/rev/3aaca0a12a2d1463da54933bdbdae2f06fead06f/devtools/client/definitions.js#270-276
STR in comment 0, mention debugging local addons, running in the same firefox instance.
I imagine that's because the (new) profiler doesn't know how to focus only one a given web-extension.
It would probably have to branch similarly to this, if this requires client-side branching:
const DESCRIPTOR_TYPES = require("devtools/client/fronts/descriptors/descriptor-types");
const { descriptorFront } = commands;
if (descriptorFront.descriptorType == DESCRIPTOR_TYPES.EXTENSION) {
const addonId = descriptorFront.id;
// Somehow focus on this add-on only
}
Or use sessionContext.type == "webextension" and sessionContext.addonId, if this would be better done from the server side.
Comment 10•4 years ago
|
||
probably not, thanks for asking
Comment 11•2 years ago
|
||
This is still a pretty significant bug:
- it seems like the option to profile the whole browser from profiler.firefox.com has disappeared, and now the only way to do this is clicking the "profile for 5 seconds" button in about:processes
- there's no way to view the memory consumption, do a heap dump, sample allocations, etc of the extension process.
Comment 12•2 years ago
|
||
(In reply to me from comment #11)
Hey, thanks for your comment! Here are a few answers, tell me what you think afterwards.
This is still a pretty significant bug:
- it seems like the option to profile the whole browser from profiler.firefox.com has disappeared, and now the only way to do this is clicking the "profile for 5 seconds" button in about:processes
The new profiler always profiles the whole browser !
For example if you add the tabbar button from profiler.firefox.com, and you use it to profile, that will profile the whole browser (like I mentioned in comment 1).
Even when using the firefox devtools panel, that profiles the whole browser currently (but that one may change in the future).
- there's no way to view the memory consumption, do a heap dump, sample allocations, etc of the extension process.
You can see the memory consumption of every process in the resulting profile as captured above.
You can also sample allocations using the "native allocations" feature enabled in about:profiling (I believe it is Nightly only, might be Dev Edition too), then from the profiler UI you can select various allocations-related options in a dropdown. More information about that in our dedicated documentation page.
Memory dump is another subject. I'm not sure about that actually, but this is a separate issue. I filed bug 1882991 for that one.
Please tell me if I missed anything from your questions.
Description
•