burningmoth / burningmoth-chromelogger-firefox

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

ChromeLogger data not appearing in Console of FireFox Developer Edition #4

Closed Zxurian closed 6 years ago

Zxurian commented 6 years ago

Currently using Firefox Developer Edition, v62.0b12 (64-bit) Using Chrome Logger 1.6.1 available from Firefox Extension store (https://addons.mozilla.org/en-US/firefox/addon/chromelogger/)

I'm trying to test it with monolog's ChromePHP's Handler (https://github.com/Seldaek/monolog/blob/master/src/Monolog/Handler/ChromePHPHandler.php) however I'm not getting any output in Firefox's console.

I've verified that the X-ChromeLogger-Data header is present in response headers (example output below). Chrome is properly outputting the messages in the console, but they're not visible in Firefox. I realize that #3 was marked closed, however that involves switching to a separate library to log messages, and I'd prefer to use what appears to be a built-in handler within monolog, that does appear to work, just not being processed correctly by this extension.

X-ChromeLogger-Data header value

eyJ2ZXJzaW9uIjoiNC4wIiwiY29sdW1ucyI6WyJsYWJlbCIsImxvZyIsImJhY2t0cmFjZSIsInR5cGUiXSwicm93cyI6W1siYXNzZXQtcHJvY2Vzc2luZyIsIm9tZyB3YXJuaW5nIiwidW5rbm93biIsIndhcm4iXSxbImFzc2V0LXByb2Nlc3NpbmciLCJ0aGlzIGlzIG9ubHkgYSB0ZXN0IiwidW5rbm93biIsImluZm8iXSxbImFzc2V0LXByb2Nlc3NpbmciLHsibWVzc2FnZSI6ImhlcmUgYmUgZHJhZ29ucyIsImNvbnRleHQiOnsiZm9vIjoiYmFyIiwiMSI6Im9tZyEifX0sInVua25vd24iLCJsb2ciXV0sInJlcXVlc3RfdXJpIjoiXC8ifQ
tarraccas commented 6 years ago

The extension implements the Chrome Logger protocol as it is defined. If you know this not to the case, please point out the code in error. I've made corrections and more flexible implementations of the protocol per user suggestion but, as this is freeware, I reasonably don't test against other libraries implementing the protocol that I'm not already using.

Ensure that the devtools is open on the tab you're looking to debug before you navigate to or reloading the location being monitored.

Zxurian commented 6 years ago

fair enough. the monolog library uses pretty standard implementations of ChromeLogger, and as it works in Chrome using the chrome extension, I would assume that the same data would work in Firefox using your extension. We ended up going a different direction for our use case. Thanks though.

tarraccas commented 6 years ago

I think I see now. Your data defines a fourth column, "label", which isn't in the Chrome Logger spec and that the extension doesn't [yet] account for.