A short addendum:
If I define a content type "?from=text/xml2&to=*/*"; and receive a
document with content-type text/xml2 everything works fine.
So, is seems that the content type is already registered (surprise!). Is
there a way to override the text/xml content-type handling of Firefox?
Thanks,
Steffen
Steffen Heinzl wrote:
> Thank you very much. That really helped.
>
> Now, I've got a question relating to the content type.
> I have installed the wmlbrowser extension to my firefox and now try to
> change the content type in the source code.
> They define a content type for wml:
>
> const WMLSTREAM_CONVERT_CONVERSION = "?from=text/vnd.wap.wml&to=*/*";
>
> If I try to change it to one of the following versions nothing happens:
> "?from=text/xml&to=text/html";
> "?from=text/xml&to=*/*";
> "?from=text/html&to=*/*";
>
> The StreamConverter is not invoked. I wanted to react to wsdl documents
> which are (in my case) of the content type text/xml.
> The last (html) version is not invoked either when trying to obtain an
> HTML site like google.com.
>
>
> registerSelf contains the following code:
>
> const WMLSTREAM_CONVERT_CONVERSION = "?from=text/xml&to=text/html";
> //"?from=text/vnd.wap.wml&to=*/*";
> const WMLSTREAM_CONVERTER_CONTRACTID =
> "@mozilla.org/streamconv;1" + WMLSTREAM_CONVERT_CONVERSION;
>
> const WMLSTREAM_CONVERTER_CID =
> Components.ID("{51427b76-8626-4a72-bd5f-2ac0ce5d101a}");
>
> WMLBrowserModule.registerSelf =
> function (compMgr, fileSpec, location, type)
> {
> dump("registerSelf\n");
> var compMgr =
> compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
>
> compMgr.registerFactoryLocation(WMLSTREAM_CONVERTER_CID,
> "WML Stream Converter",
> WMLSTREAM_CONVERTER_CONTRACTID,
> fileSpec,
> location,
> type);
>
> var catman = Components.classes["@mozilla.org/categorymanager;1"]
> .getService(Components.interfaces.nsICategoryManager);
> catman.addCategoryEntry("@mozilla.org/streamconv;1",
> WMLSTREAM_CONVERT_CONVERSION,
> "WML to HTML stream converter",
> true, true);
> };
>
>
> Thanks again,
> Steffen
>
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network