Skip to content
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

Form target iframe not catched by Tracy #427

Open
midlan opened this issue Jul 23, 2020 · 0 comments
Open

Form target iframe not catched by Tracy #427

midlan opened this issue Jul 23, 2020 · 0 comments

Comments

@midlan
Copy link

midlan commented Jul 23, 2020

Bug Description

Tracy is not catching request of form with target to hidden iframe. See example below.

Steps To Reproduce

Sample test file:

<?php

require 'vendor/autoload.php';

\Tracy\Debugger::enable(false);

    //form sent
    if (!empty($_POST['data'])) : ?>
<script>
    parent.setHeader(<?php echo json_encode($_POST['data']); ?> + ' recieved!');
</script>
<?php
        exit; //exit to only send script
    endif;

?><!DOCTYPE html>
<html>
  <head>
    <title>Example of async iframe + tracy</title>
  </head>
  <body>
    <iframe name="hiddenIframe" style="display: none;"></iframe>
    <h1 id="status">Wait to send ...</h1>
    <form target="hiddenIframe" action="<?php echo basename(__FILE__); ?>" method="post">
        <input type="text" name="data" />
        <input type="submit" />
    </form>
    <script>
        function setHeader(header) {
            document.getElementById('status').innerText = header;
        }
    </script>
  </body>
</html>

When you hit submit, async request is created but visually tracy did not catch it.

In fact it catched, but it started another tracy instance inside the hidden iframe.

Expected Behavior

I would expect that tracy in the main frame will show the request.

Possible Solution

I think tracy could inject some javascript that will catch form submit event with different target I guess?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant