Skip to content

Ajax debug toolbar display only request starting with "/" #12221

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

Closed
arno14 opened this issue Oct 13, 2014 · 3 comments
Closed

Ajax debug toolbar display only request starting with "/" #12221

arno14 opened this issue Oct 13, 2014 · 3 comments

Comments

@arno14
Copy link

arno14 commented Oct 13, 2014

I am just testing the new ajax debug toolbar and my request are not visible in the profiler.
It works if the url are relatives and not absolute.
"http://localhost/sf_test/app_dev.php/demo/test" is not handled, but "/sf_test/app_dev.php/demo/test" works.

That seems normal regarding this code:

/* prevent logging AJAX calls to static and inline files, like templates */
if (url.substr(0, 1) === '/' && !url.match(new RegExp("{{ excluded_ajax_paths }}"))) {

https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig#L181

excluded path does not work also:
"http://localhost/sf_test/app_dev.php/_wdt" does not match regexp "^/_wdt".

Did I miss something ?

tested on Firefox and Chrome (Ubuntu)

@mykiwi
Copy link
Contributor

mykiwi commented Oct 19, 2014

For the /_wdt I created a PR : #12124

@bobvandevijver
Copy link
Contributor

I am experiencing the same issue: simply removing the first part (url.substr(0, 1) === '/') solves the problem.

In my opinion, I do not care whether external ajax requests are given in this overview. I think it is more important to see all my own AJAX requests, instead of missing them because of this. I can also imagine that we want to filter the external URL's, but I would do that somewhat else. Possible solutions:

  • Search field to search in the captured ajax request
  • Filter the requests (after capture) by default on the domain of the current window.
  • Together with the previous point, it can be considered to add a checkbox to enable and disable that filtering.

Simply changing the AJAX urls is not an option for me, as they are not generated directly with Symfony within a template, but from an exposed routing export, as sometimes variables still need to be filled in.

@fabpot: If wanted, I can create an PR for the 2.6 branch. Could you elaborate on the best solution?

@sormy
Copy link

sormy commented Jun 7, 2015

I am experiencing the same issue

fabpot added a commit that referenced this issue Jan 25, 2016
…javiereguiluz)

This PR was merged into the 2.7 branch.

Discussion
----------

Allow absolute URLs to be displayed in the debug toolbar

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12221
| License       | MIT
| Doc PR        | -

If you agree with the original issue, this should do the trick. If you don't agree, please explain the reasons and close #12221. Thanks!

Commits
-------

11b63ff Allow absolute URLs to be displayed in the debug toolbar
@fabpot fabpot closed this as completed Jan 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants