JS Tracer - Top level js calls don't get a JS Frame
Categories
(DevTools :: Debugger, defect, P2)
Tracking
(Not tracked)
People
(Reporter: fkilic, Assigned: alexical)
References
Details
Attachments
(2 files)
Thank you for helping make Firefox better. If you are reporting a defect, please complete the following:
What were you doing?
This is a follow-up to a discussion on Matrix.
I was profiling (here's the profile) my website, and noticed top-level JS calls (e.g. fetch calls in the profile linked) don't get their own JS frames.
I'm trying to automate Firefox to gather JS APIs websites use here, and I use JS frames to associate (DOM) Something.Something
entries in the profile to their scripts and pages, but it seems top-level JS calls don't get a JS frame and are children of root directly.
Please tell us what site you were on, and what steps led to the error you are reporting
- Change profiler config to: Threads="GeckoMain", Features="JavaScript, No Periodic Sampling, JS Execution Tracing"
- Visit my website
- Start profiler
- Refresh page
- Stop/Capture profiler/profile
What happened?
fetch
calls didn't get a JS frame in the call stack
What should have happened?
Some call stack similar to the one in DevTools > Network (for example, it shows <anonymous> https://fklc.dev/:1:18883
)
Anything else we should know?
The following is the code that runs on my page. From the profile, it looks like anything that has a some sort of scope gets their JS frame (i.e. the calls in fetch's then
has (root scope)
JS frame), and top-level calls (fetchs in this case) don't.
function renderRepo(t) {
return `
<a href="${ t.html_url }" target="_blank" rel="noopener">
<section>
<div class="section_title">${ t.name }</div>
<div class="about_section">
<span>${ t.description }</span>
</div>
<div class="bottom_section">
<span style="display:inline-block;"><i class="fa-code"></i> ${ t.language }</span>
<span><i class="fa-star"></i> ${ t.stargazers_count }</span>
<span><i class="fa-code-branch"></i> ${ t.forks }</span>
</div>
</section>
</a>`
}
const username = 'FKLC';
fetch('https://api.github.com/users/FKLC').then((t => t.json())).then(
(
t => {
document.title = t.name,
document.querySelector('meta[name=\'description\']').setAttribute('content', t.bio),
document.querySelector('link[rel=\'shortcut icon\']').setAttribute('href', t.avatar_url),
document.getElementById('profile_img').style = `background: url(${ t.avatar_url }) center;`,
document.getElementById('username').innerHTML = `<span style="display:block;">${ t.name }</span>@${ t.login }`,
document.getElementById('userbio').innerHTML = t.bio,
document.getElementById('about').innerHTML = [
t.company &&
`<span><i class="fa-users"></i> ${ t.company }</span>`,
t.email &&
`<span><i class="fa-envelope"></i> ${ t.email }</span>`,
t.blog &&
`<span><i class="fa-link"></i> ${ t.blog }</span>`,
t.location &&
`<span><i class="fa-map-marker"></i> ${ t.location }</span>`,
t.hireable &&
'<span><i class="fa-user-tie"></i> Available for hire</span>'
].join('')
}
)
),
fetch(
'https://api.github.com/search/repositories?q=user:FKLC fork:false&sort=stars'
).then((t => t.json())).then(
(
t => {
const e = [];
for (let n of t.items) e.push(renderRepo(n));
document.getElementById('work_section').innerHTML = e.join('')
}
)
);
Do you have extensions installed? You can also go to about:support
in another window or tab and attach the report it generates to this bug.
No, I was using yesterday's (3 Dec 2024) mozilla-central build around 9:30, on macos, with a clean profile.
Assignee | ||
Comment 2•2 months ago
|
||
I think I just initially excluded these to narrow down what I had to cover
in my initial implementation, but it seems like we can fairly trivially
include non-function frames.
Updated•2 months ago
|
Assignee | ||
Comment 3•2 months ago
|
||
This is basically just adjustint to a few changes on the spidermonkey side
which allow us to include non-function frames in the trace.
Assignee | ||
Updated•2 months ago
|
Comment 4•2 months ago
|
||
The severity field is not set for this bug.
:bomsy, could you have a look please?
For more information, please visit BugBot documentation.
Comment 5•1 month ago
|
||
Making this a P2 since its been worked on
Description
•