nsISupports
Last changed in Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0)Implemented by: @mozilla.org/webnavigation-info;1
as a service:
var webNavigationInfo = Components.classes["@mozilla.org/webnavigation-info;1"] .getService(Components.interfaces.nsIWebNavigationInfo);
unsigned long isTypeSupported(in ACString aType, in nsIWebNavigation aWebNav); |
Constant | Value | Description |
UNSUPPORTED |
0 |
Returned by Note: This is guaranteed not to change, so that boolean tests can be done on the return value if isTypeSupported to detect whether a type is supported at all. |
IMAGE |
1 |
Returned by isTypeSupported() to indicate that a type is supported as an image . |
PLUGIN |
2 |
Returned by isTypeSupported() to indicate that a type is supported via an NPAPI ("Netscape 4 API") plug-in. This is not the value returned for "XPCOM plug-ins". |
OTHER |
1 << 15 |
Note: Other return types may be added here in the future as they become relevant.
Returned by isTypeSupported() to indicate that a type is supported via some other means. |
Determines whether or not the specified MIME type is supported by the given nsIWebNavigation
object. This lets you determine whether a MIME type can be displayed as-is inside a browser, or if the browser will instead forward handling of the data to a plug-in or an external helper application.
unsigned long isTypeSupported( in ACString aType, in nsIWebNavigation aWebNav );
aType
aWebNav
nsIWebNavigation
object on which to check for compatibility. You may specify null
to check for compatibility with nsIWebNavigation
objects that are in their default state; otherwise, the result is determined based on the configuration of the specified object (that is, how it is configured by using nsIWebBrowserSetup
).Returns one of the Support type constants, indicating whether or not the specified MIME type is supported, and in what form that support exists.
let webnavigationinfo_service = Components.classes["@mozilla.org/webnavigation-info;1"] .getService(Components.interfaces.nsIWebNavigationInfo); let support_code = webnavigationinfo_service.isTypeSupported(contentType, null); if (support_code == webnavigationinfo_service.UNSUPPORTED) { dump("Unsupported content-type: not displaying in the browser\n"); }