ssborbis / ContextSearch-web-ext

Search engine manager for modern browsers
329 stars 37 forks source link

[Bug] ContextSearch extension broke Firefox's built in XML document viewer #534

Closed jcunews closed 1 year ago

jcunews commented 2 years ago

In Firefox, ContextSearch extension broke Firefox's built in XML document viewer.

Steps to reproduce the problem:

  1. Disable all browser extensions including ContextSearch extension.

  2. Open any XML document in any browser tab. For example:

    https://www.w3schools.com/xml/note.xml

    Expected result:

    Firefox displays the XML document using the built in XML document viewer. Screenshot:

    extension-disabled

  3. Enable ContextSearch extension.

    Actual result:

    Firefox's XML document viewer is replaced with the HTML view of the XML document. Screenshot:

    extension-enabled

    Note: reloading the browser tab (which displays the XML document) may be necessary.

As shown in Firefox's Developer's Tools, ContextSearch extension modifies the XML document. That operation broke Firefox's XML document viewer.

Conclusion:

In Firefox, the DOM should not be modified when Firefox is presenting its built in XML document viewer. i.e. when document.contentType is application/xml or any other XML MIME types which are also handled by Firefox's built in XML document viewer. This is because the document is contained within an XMLDocument object, unlike Firefox's built in image and JSON resource viewer where the resource is contained within a HTML document which is the image/JSON viewer application itself..

ssborbis commented 2 years ago

Gotcha. I'll play around and try to find the best way to filter out pages. For now, you can add a rule to the blocklist. *.xml should work for most cases.

ssborbis commented 2 years ago

Fix in the development branch.

ssborbis commented 2 years ago

check new release 1.43 for fixes