burningmoth / burningmoth-chromelogger-firefox

WebExtension implementing Chrome Logger protocol for Firefox
15 stars 12 forks source link

No backtrace info for console.table #8

Closed tminich closed 5 years ago

tminich commented 5 years ago

Love the extension, there is just one small issue I have: If I use console.table the title of the log message only shows 'console.table()' but no backtrace information like all the other log commands.

The group__ commands also don't show backtrace info, but arguably it's not really necessary there. Would be nice to have on .table though.

tarraccas commented 5 years ago

I don't remember if Firefox Web Console always displayed that extraneous "console.table()" message but that's just the way it shows currently. Annoying, I know. There doesn't appear to be anything I can do about that from the extension end short of supporting the various console methods. It's up to the server side process generating the chromelogger data to feed these methods the data that gets displayed, including any backtrace information.

A label argument can be passed to group or groupCollapsed methods. Not so for the table method: https://developer.mozilla.org/en-US/docs/Web/API/Console/table

tminich commented 5 years ago

Ah ok, I didn't realize FF does this automatically, to be honest I didn't even know console.table existed until I found this extension :) The backtrace info should be present thought, the original Chrome extension shows it. Not sure how feasible/complex it would be to display it. As far as I understand Chrome has no special way to show the backtrace, so the extension always logs it as a separate line before the actual log output, so that could be an option.

tarraccas commented 5 years ago

Whether it's on Chrome or Firefox, the extension can only display what it is provided to it by the server. If you want a backtrace, the server must generate and provide it to the extension formatted according to the chromelogger protocol. If the server side library you're using to do this is giving you different results for two different browsers then it, not the extension, is discriminating between said browsers.

tminich commented 5 years ago

Good point, so I checked. The X-ChromeLogger-Data header is identical on both browsers. I also manually decoded the data and it contains the backtrace for the table log entry so the chrome extension isn't even infering from other log data.

tarraccas commented 5 years ago

The only automatic backtrace I get in Firefox is for console.error() referencing the brief javascript stack leading back to the extension calling it. Which isn't especially useful in the context of debugging server-side scripts. Perhaps this is also what's being generated in Chrome for other methods.