Avoid disabling Firefox XML pretty printing #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Firefox displays XML documents with unsupported namespaces that lack XSL stylesheets using
nsXMLPrettyPrinter
which produces an interactive tree view of the XML content. If any content is appended, the pretty printing is disabled because it no longer matches the modified DOM. This was modified in Bug 1605657 to exclude changes made by by extensions during document_start, but it does not exclude changes made later (e.g. on DOMContentLoaded as this extension does).Rather than injecting the <script> during document_start, this pull request takes the approach of React DeveloperTools and only injects scripts for (X)HTML documents. Note that this pull request additionally recognizes XHTML documents served as application/xml or text/xml by checking the namespace of the document element. Even with this additional coverage, it does not recognize embedded XHTML (such as <xhtml:video> in SVG) or other exotic document types. DOM traversal could be added to cover more of these cases, if desired.
Thanks for considering,
Kevin