Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WebProfilerBundle] Add settings to have the profiler follow the browser#54638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
jtattevin wants to merge1 commit intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromjtattevin:ProfilerRefresh

Conversation

jtattevin
Copy link

@jtattevinjtattevin commentedApr 17, 2024
edited by nicolas-grekas
Loading

QA
Branch?7.2
Bug fix?no
New feature?yes
Deprecations?no
LicenseMIT

Often during development, we load a page, check some informations in the profiler, see something wrong, fix, reload the page, reload the profiler. That mean that we often reload the profiler page.
If we can use the 'latest' token it's ok, but if there is another controller called (for example a webmanifest), we either need to search for it or close the tab, then reopen a new tab.

This change use the BroadcastChannel javascript api to broadcast to other tabs that a toolbar have loaded or that an ajax request have finished. The profiler page listen to this broadcast and load the new profiler page based on the token broadcasted. A new setting allow to choose if :

  • We don't want this behavior
  • We want to follow only the main requests where a toolbar is shown (default)
  • We also want to follow ajax call captured by the toolbar

The settings section look like that :
image

I didn't submit a PR to the doc side, as it seem that there is no section related to the settings.

OskarStark, raziel057, and alamirault reacted with thumbs up emojiPapsOu reacted with eyes emoji
ro0NL

This comment was marked as outdated.

@jtattevin
Copy link
Author

💯 is there any reason to not follow the browser by default?

To keep the same behavior than before, I often compare two profiler page, so having the profiler follow by default would break this workflow, I find better to have the user opt-in for that

@jtattevin
Copy link
Author

jtattevin commentedApr 18, 2024
edited
Loading

Thank for the feedback, it helped to refine the idea.

The current default setting look like that :
image

So now by default, it track the browser, and don't load automatically.

When a page load is detected, it look like that :
image
The link is focused by default, so if you change tab, you can validate by pressing enter

For the automatic part, depending on the feedback, i may remove it from the PR and keep it as a local change only as i'm not sure if the way it's done currently is the best way and i don't find another method that would work better.
If the profiler change automatically, this toolbar is shown :
image
The go back link is a javascript link to go back.
The toolbar disapear after 10s after being shown to the user.

@smnandre
Copy link
Member

This feature seems very nice!

Personally, when working on a webapp I almost every time have multiple "web" pages open and multiple profiler tabs, and i really would not want them to be refreshed without my active action ;)

ju1ius reacted with thumbs up emoji

@@ -292,6 +292,7 @@
profilerCell.appendChild(profilerLink);
}

broadCastToken(request.profile, "ajax", request.url);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
broadCastToken(request.profile, "ajax", request.url);
if(request.profilerUrl) {
broadCastToken(request.profile, "ajax", request.url);
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Good catch ! I didn't think about element that was not profiled.

I've made the change and moved the block to be near the logic of reloading the toolbar if needed, so that we only trigger once the broadcasting. I check for request.profile instead of request.profilerUrl to be more consistent with the parameter of the function and the toolbar replace behavior

smnandre reacted with thumbs up emoji
@jtattevinjtattevinforce-pushed theProfilerRefresh branch 2 times, most recently from2b4d365 to0cef377CompareApril 20, 2024 09:00
@jtattevin
Copy link
Author

On the last PR, i've made a change to use sessionStorage (which is tab scoped) to track if you want to follow the browser or not.
That way you can have a profiler automatically tracking the page and open in new tabs the profiler you want to keep.

By default, you'll have this toolbar shown :
image

If you click on "Follow the browser automatically", then this tab only will begin following and will look now like that :
image

And then, when a new page is loaded, the toolbar is updated to show that the page was reloaded with an option to disable this behavior :
image

This also mean that the checkbox that was in the settings was removed.

@nicolas-grekasnicolas-grekas modified the milestones:7.1,7.2May 2, 2024
…ser.Often during development, we load a page, check some informations in the profiler, see something wrong, fix, reload the page, reload the profiler.That mean that we often reload the profiler page.If we can use the 'latest' token it's ok, but if there is another controller called (for example a webmanifest), we either need to search for it or close the tab, then reopen a new tab.This change use the BroadcastChannel javascript api to broadcast to other tabs that a toolbar have loaded or that an ajax request have finished.The profiler page listen to this broadcast and show a toolbar with the new profiler page based on the token broadcasted.A new setting allow to choose if :- We don't want this behavior- We want to follow only the main requests where a toolbar is shown (default)- We also want to follow ajax call captured by the toolbar
@fabpotfabpot modified the milestones:7.2,7.3Nov 20, 2024
@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ro0NLro0NLro0NL left review comments

@smnandresmnandresmnandre left review comments

Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

6 participants
@jtattevin@smnandre@ro0NL@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp