-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 7.4
Are you sure you want to change the base?
Conversation
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/settings.html.twig
Outdated
Show resolved
Hide resolved
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 |
0777123
to
df46ec1
Compare
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 ;) |
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/settings.html.twig
Outdated
Show resolved
Hide resolved
@@ -292,6 +292,7 @@ | |||
profilerCell.appendChild(profilerLink); | |||
} | |||
|
|||
broadCastToken(request.profile, "ajax", request.url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
broadCastToken(request.profile, "ajax", request.url); | |
if (request.profilerUrl) { | |
broadCastToken(request.profile, "ajax", request.url); | |
} |
There was a problem hiding this comment.
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
2b4d365
to
0cef377
Compare
…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
0cef377
to
00429e9
Compare
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 :
The settings section look like that :

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