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

Broken Tracy bar when used with BrowserSync #48

Closed
adamkudrna opened this issue Jul 7, 2014 · 5 comments
Closed

Broken Tracy bar when used with BrowserSync #48

adamkudrna opened this issue Jul 7, 2014 · 5 comments

Comments

@adamkudrna
Copy link

When using Tracy together with BrowserSync, Tracy bar produces invalid HTML code at the end of file like this:

<!-- Tracy Debug Bar -->
<script>
(function(onloadOrig) {
    window.onload = function() {
        if (typeof onloadOrig === 'function') onloadOrig();
        var debug = document.body.appendChild(document.createElement('div'));
        debug.id = 'tracy-debug';
        debug.innerHTML = "&nbsp;\n\n<style id=\"tracy-debug-style\"

// …
// Tracy's code continues.
// …

doc = win.document;\n\t\tdoc.write('<!DOCTYPE html><meta charset=\"utf-8\"><style>' + $('#tracy-debug-style').dom().innerHTML + '<\\\/style><script>' + $('#tracy-debug-script').dom().innerHTML + '<\\\/script><body id=\"tracy-debug\">
<script type='text/javascript'>//<![CDATA[
;document.write("<script defer src='//HOST:3000/socket.io/socket.io.js'><\/script><script defer src='//HOST:3001/client/browser-sync-client.0.9.1.js'><\/script>".replace(/HOST/g, location.hostname));
//]]></script>
');\n\t\tdoc.body.innerHTML = '<div class="\&quot;tracy-panel" tracy-mode-window\"=""

// Unescaped HTML continues.
// …

BrowserSync also injects JS a HTML into DOM which seems to be the cause of conflict. You may notice socket.io script injected by BrowserSync close to the end. However, since BrowserSync itself works fine with Tracy and does not seem to be affected by this error, it looks like it is Tracy's issue. If not, please let me know to report the issue at BrowserSync.

@dg
Copy link
Member

dg commented Jul 7, 2014

Tracy produces syntactically valid code, so it is almost certainly not Tracy issue.

@adamkudrna
Copy link
Author

OK, thanks for quick response.

@enzy
Copy link

enzy commented Jul 25, 2014

And isn't in that syntactically valid code anything unusual? Something what proxy developers could ignore as obsolote, not used, etc.

@hrach
Copy link
Contributor

hrach commented May 2, 2015

Have somebody solved this? cc @enzy

@enzy
Copy link

enzy commented May 3, 2015

We have some sort of workaround in mango-cli watch task which works for us...

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

4 participants