Describe the bug
When viewing a URL with JSON content (application/json), Firefox uses a built in JSON viewer.
The debug mode cannot be changed, for pages/responses handled by the JSON viewer.
This seems to be due to the extension's content script not being loaded, when the JSON viewer handles rendering.
Error in Browser Console:
Error during tab update: Error: Could not establish connection. Receiving end does not exist.
<anonymous> moz-extension://159b81ff-8130-489b-9e32-07b9cc23f742/service_worker.js:46
To Reproduce
Steps to reproduce the behavior:
- With xDebug extension installed in Firefox
- Open the Browser Console (CTRL + SHIFT + J) - not DevTools
- Go to a url where raw JSON is returned, e.g. https://jsonplaceholder.cypress.io/todos/14
- See error in the browser console window, when navigating to the page
- Click the xDebug button and try to switch mode
- See same error in the Browser Console
- The debug mode is not toggled. Not for the domain and not in the interface. E.g. the button does not turn green when clicking Debug
Expected behavior
- When navigating to the url returning JSON, I expect to see the current debug state for the domain
- When clicking e.g. Debug I expect debug mode to be enabled
Screenshots
None
Desktop (please complete the following information):
- OS: Windows 11
- Browser: Firefox 151.0
Smartphone (please complete the following information):
None
Additional context
Disabling the JSON viewer (enabled by default in Firefox, devtools.jsonview.enabled) results in the extension working correctly, when toggling the button.
I couldn't reproduce the issue for the JSON viewer in Chrome, where it works as expected.
Toggling debug mode for the example domain, can be done by visiting a url not returning JSON, e.g. the main website: https://jsonplaceholder.cypress.io
Which is a simple workaround, but slightly annoying for an otherwise happy user of the extension like me.
Another workaround is using a JSON viewer that is not the default, built-in viewer.
Describe the bug
When viewing a URL with JSON content (application/json), Firefox uses a built in JSON viewer.
The debug mode cannot be changed, for pages/responses handled by the JSON viewer.
This seems to be due to the extension's content script not being loaded, when the JSON viewer handles rendering.
Error in Browser Console:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Screenshots
None
Desktop (please complete the following information):
Smartphone (please complete the following information):
None
Additional context
Disabling the JSON viewer (enabled by default in Firefox,
devtools.jsonview.enabled) results in the extension working correctly, when toggling the button.I couldn't reproduce the issue for the JSON viewer in Chrome, where it works as expected.
Toggling debug mode for the example domain, can be done by visiting a url not returning JSON, e.g. the main website: https://jsonplaceholder.cypress.io
Which is a simple workaround, but slightly annoying for an otherwise happy user of the extension like me.
Another workaround is using a JSON viewer that is not the default, built-in viewer.