FirefoxBar / xStyle

A user styles manager for Firefox and Chrome

Home Page:http://team.firefoxcn.net/#addons

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XML Formatting

Pok-Pok opened this issue · comments

Normally, XML documents are displayed as a tree, in which the node names and attributes are visible.
If xStyle has some style for the domain or the URL of a document of type „text/xml”, it is no longer displayed correctly: only the text nodes are shown, no element, no attributes - as when a plain text document is loaded as HTML. Even if the style matched is empty.
Documents of type „text/xml” should not be changed by xStyle, even if domain or url rules match for the URI of the xml document. The built-in XML „viewer” should be untouched. Or at least an option should be added to exclude such document types from styling.
no-xstyle
xstyle

I think do not apply to xml is not suitable. Maybe an "exclude" rule is better?

@sylingd If exclusion could/would work by content type, for sure.
In practice the same URL could point to both xml or any other type.
Think of one that accepts GET/POST arguments and according to some GET/POST parameter it serves any kind of document type; e.g. https://example.com/get_document.php?id=whatever could sometimes return an HTML document, other times an XML document, yet other times a TXT document. Given that parameters would be dynamic, it would by hard to exclude anything just by URL, domain, etc.

I would add to the original report, that the content of the XML file is modified, in that elements containing applied styles are added to the original tree, e.g:

<style id="xstyle-5" class="xstyle" type="text/css">@namespace html url(http://www.w3.org/1999/xhtml);
body {
		font-size: 11pt;
		}
</style>

Sometimes hitting refresh repeatedly on the XML document displays it as an XML tree, but with the above element(s) added.

I have found a method to detect a page type, I will make it optional

It seems that Firefox have fixed this BUG, do you try it in the lastest nightly?

I have just downloaded the nightly version. The problem remains: when the extension is enabled, the XML file is displayed as an HTML file (only the text content is visible, not the grammar, nodes, attributes, etc). When the extension is disabled, the XML file is shown properly.
I don't know if it is of interest to you, but I have discovered that the same thing happens when Tampermonkey is enabled/disabled (independently from xStyle).

Please try the new xstyle version

I have installed version 3.0.3 and with the new option enabled, xml files are shown as before. I will continue to test it and will report back if I find something.
Thank you for the new option!