draft-ietf-trade-mime-detector-02.txt   rfc2936.txt 
INTERNET-DRAFT MIME Handler Detection Network Working Group D. Eastlake
March 2000 Request for Comments: 2936 Motorola
Expires September 2000 Category: Informational C. Smith
Royal Bank of Canada
D. Soroka
IBM
September 2000
HTTP MIME Type Handler Detection HTTP MIME Type Handler Detection
---- ---- ---- ------- ---------
<draft-ietf-trade-mime-detector-02.txt>
Donald E. Eastlake 3rd
Chris J. Smith
David M. Soroka
Status of This Document
This draft is intended to become an Informational RFC. Distribution Status of this Memo
of this document is unlimited. Comments should be sent to the TRADE
WG mailing list <ietf-trade@eListX.com> or to the authors.
This document is an Internet-Draft and is in full conformance with
all provisions of Section 10 of RFC2026. Internet-Drafts are working
documents of the Internet Engineering Task Force (IETF), its areas,
and its working groups. Note that other groups may also distribute
working documents as Internet-Drafts.
Internet-Drafts are draft documents valid for a maximum of six months This memo provides information for the Internet community. It does
and may be updated, replaced, or obsoleted by other documents at any not specify an Internet standard of any kind. Distribution of this
time. It is inappropriate to use Internet- Drafts as reference memo is unlimited.
material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at Copyright Notice
http://www.ietf.org/ietf/1id-abstracts.txt
The list of Internet-Draft Shadow Directories can be accessed at Copyright (C) The Internet Society (2000). All Rights Reserved.
http://www.ietf.org/shadow.html.
Abstract Abstract
Entities composing web pages to provide services over HTTP frequently Entities composing web pages to provide services over the Hypertext
have the problem of not knowing what MIME types have handlers Transfer Protocol (HTTP) frequently have the problem of not knowing
installed at a user's browser. For example, whether an IOTP or VRML what Multipurpose Internet Mail Extensions (MIME) types have handlers
or SET or some streaming media handler is available. In many cases installed at a user's browser. For example, whether an Internet Open
they would want to display different web pages or content depending Trading Protocol (IOTP) or VRML or SET or some streaming media
on a MIME handler's availability. This document summarizes handler is available. In some cases they would want to display
reasonable techniques to solve this problem for most of the browsers different web pages or content depending on a MIME handler's
actually deployed on the Internet as of early 2000. It is intended availability. This document summarizes reasonable techniques to
to be of practical use to implementors during the period before the solve this problem for most of the browsers actually deployed on the
wide deployment of superior standards based techniques which may be Internet as of early 2000. It is intended to be of practical use to
developed. implementors during the period before the wide deployment of superior
standards based techniques which may be developed.
Table of Contents
Status of This Document....................................1
Abstract...................................................1
Table of Contents..........................................2
1. Introduction............................................3 Acknowledegements
2. The HTTP 'Accept' Header................................3
3. JavaScript..............................................3
4. Microsoft ActiveX and the Windows Registry..............4
5. ECML, The Electronic Commerce Modeling Language.........5
6. Putting It All Together.................................5
7. Future Development......................................6
8. Security Considerations.................................6
9. IANA Considerations.....................................7
References.................................................8 Helpful comments by Tony Lewis of Visa have been incorporated.
Appendix A: Browser Version Sniffer Code...................9 Table of Contents
Authors Addresses.........................................13 1. Introduction................................................. 2
Expiration and File Name..................................13 2. The HTTP 'Accept' Header..................................... 2
3. JavaScript................................................... 3
4. ActiveX and the Windows Registry............................. 4
5. ECML, The Electronic Commerce Modeling Language.............. 4
6. Putting It All Together...................................... 5
7. Future Development........................................... 5
8. Security Considerations...................................... 5
9. IANA Considerations.......................................... 6
References...................................................... 6
Appendix A: Browser Version Sniffer Code........................ 8
Authors' Addresses.............................................. 12
Full Copyright Statement........................................ 13
1. Introduction 1. Introduction
Entities composing web pages to provide services over [HTTP] Entities composing web pages to provide services over [HTTP]
frequently have the problem of not knowing what [MIME] types have frequently have the problem of not knowing what [MIME] types have
handlers installed at a user's browser. For example, whether an handlers installed at a user's browser. For example, whether an
[IOTP] or VRML or [SET] or some streaming media handler is available. [IOTP] or VRML or [SET] or some streaming media handler is available.
In many cases they would want to display different web pages or In many cases they would want to display different web pages or
content depending on a MIME handler's availability. Sending a content depending on a MIME handler's availability. Sending a
response with a MIME type that is not supported frequently results in response with a MIME type that is not supported frequently results in
interrupting the flow of the user experience, browser queries as to interrupting the flow of the user experience, browser queries as to
what to do with the data being provided, and, of course, failure to what to do with the data being provided, and, of course, failure to
provide the behavior that would have occurred had the correct MIME provide the behavior that would have occurred had the correct MIME
type handler been installed. type handler been installed.
This document describes reasonable techniques to solve this problem This document describes reasonable techniques to solve this problem
for most of the browsers actually deployed on the Internet as of for most of the browsers actually deployed on the Internet as of
early 2000. It is intended to be of practical use to implementors early 2000. It is intended to be of practical use to implementors
during the period before the wide deployment of superior standards during the period before the wide deployment of superior standards
based techniques which may be developed. It is written in terms of based techniques which may be developed. It is written in terms of
determining whether a handler for application/iotp or application/x- determining whether a handler for application/iotp or application/x-
iotp exists but is equally applicable to other MIME types. iotp exists but is equally applicable to other MIME types.
2. The HTTP 'Accept' Header 2. The HTTP 'Accept' Header
The problem should be solved by the Hyper Text Transport Protocol The problem should be solved by the Hyper Text Transport Protocol
[HTTP] request "Accept" header which lists accepted [MIME] types. [HTTP] request "Accept" header which lists accepted [MIME] types.
This header is present in both Version 1.0 and 1.1 of HTTP and its This header is present in both Version 1.0 and 1.1 of HTTP and its
content is supposed to be a list of MIME types and subtypes that are content is supposed to be a list of MIME types and subtypes that are
accepted. The only problem is that many browsers just send "*/*" or accepted. The only problem is that many browsers just send "*/*" or
the like. the like.
If the particular MIME type you are looking for is present in the If the particular MIME type you are looking for is specifically
Accept header, it is generally safe to assume that some specific present in the Accept header, it is generally safe to assume that a
handler for it is actually installed or part of the browser. handler for it is actually installed or part of the browser.
NOTE: Although not part of the main topic of this document, if you NOTE: Although not part of the main topic of this document, if you
are designing MIME type handler software and have access to a browser are designing MIME type handler software and have access to a browser
interface that allows you to request the insertion of the MIME type interface that allows you to request the insertion of the MIME type
or types your software handles into the Accept header, you generally or types your software handles into the Accept header, you generally
should do so. It will make it easier for servers sensitive to that should do so. It will make it easier for servers sensitive to that
MIME type to respond correctly. MIME type to respond correctly.
3. JavaScript 3. JavaScript
Most recent browsers support one or more scripting languages of which Most recent browsers support one or more scripting languages of which
the most widely deployed is "JavaScript". These scripting languages the most widely deployed is "JavaScript". These scripting languages
appear in web pages and permit the interpretive execution of appear in web pages and permit the interpretive execution of
programing language constructs that can probe the browser programming language constructs that can probe the browser
environment, conditionally cause different page contents to be environment, conditionally cause different page contents to be
displayed, etc. For example, Appendix A shows JavaScript available displayed, etc. For example, Appendix A shows JavaScript available
from the Netscape web site for determining what operating system, from the Netscape web site for determining what operating system,
browser, and version you are running on. browser, and version on which a web page is appearing.
NOTE: JavaScript is a trademark of SUN Microsystems, Inc. It was NOTE: JavaScript is a trademark of SUN Microsystems, Inc. It was
originally called LiveScript. It has nothing to do with the Java originally called LiveScript. It has nothing to do with the Java
language. language.
The syntax for script use appears to be a Hyper Text Markup Language The syntax for script use appears to be a Hyper Text Markup Language
(HTML) comment so that bowsers that do not support scripting will (HTML) comment so that browsers that do not support scripting will
ignore such items. That is, script use if preceeded by "<!--" and ignore such items. That is, script use is preceded by "<!--" and
terminated by "-->". The following is a simple example of terminated by "-->". The following is a simple example of
conditional execution of parts of a web page based on JavaScript MIME conditional execution of parts of a web page based on JavaScript MIME
type handler detection. type handler detection.
<SCRIPT LANGUAGE=JAVASCRIPT> <SCRIPT LANGUAGE=JAVASCRIPT>
<!-- hide it <!-- hide it
if (navigator.appName=="netscape") { // wise precaution if (navigator.mimeTypes && navigator.mimeTypes.length > 0) {
if ( navigator.mimeTypes["application/iotp"] || if ( navigator.mimeTypes["application/iotp"] ||
navigator.mimeTypes["application/x-iotp"]) { navigator.mimeTypes["application/x-iotp"]) {
// here if IOTP handler exists // here if IOTP handler exists
} }
else { else {
// here if IOTP handler does not exist // here if IOTP handler does not exist
} }
} }
// end and hide --> // end and hide -->
</SCRIPT> </SCRIPT>
4. Microsoft ActiveX and the Windows Registry 4. ActiveX and the Windows Registry
If running on Internet Explorer version 3 or 4, it is necessary to If running on Microsoft Windows Internet Explorer version 3 or 4, it
query to Windows Registry to determine local MIME type support. is necessary to query the Windows Registry to determine local MIME
Although these broswers support JavaScript, in v3 the mimeTypes array type support. Although these broswers support JavaScript, in v3 the
is not present and in v4 the mimeTypes array is present but always mimeTypes array is not present and in v4 the mimeTypes array is
empty. For example, executing the following code will test for present but always empty. For example, executing the following code
support of the IOTP types: will test for support of the IOTP types:
CString iotpString, xiotpString; CString iotpString, xiotpString;
char* Key, Keyx; char* Key, Keyx;
int rc, rcx; int rc, rcx;
iotpString = iotpString =
"SOFTWARE\Classes\MIME\Database\Content Type\application/iotp"; "SOFTWARE\Classes\MIME\Database\Content Type\application/iotp";
xiotpString = xiotpString =
"SOFTWARE\Classes\MIME\Database\Content Type\application/x-iotp"; "SOFTWARE\Classes\MIME\Database\Content Type\application/x-iotp";
Key = iotpString.GetBuffer(1); Key = iotpString.GetBuffer(1);
Keyx = xiotpString.GetBuffer(1); Keyx = xiotpString.GetBuffer(1);
rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, Key, 0, KEY_READ, hDefKey); rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, Key, 0, KEY_READ, hDefKey);
rcx = RegOpenKeyEx(HKEY_LOCAL_MACHINE, Key, 0, KEY_READ, hDefKey); rcx = RegOpenKeyEx(HKEY_LOCAL_MACHINE, Keyx, 0, KEY_READ, hDefKey);
if ( ( rc == ERROR_SUCCESS ) || ( rcx == ERROR_SUCCESS ) ) if ( ( rc == ERROR_SUCCESS ) || ( rcx == ERROR_SUCCESS ) )
{ {
// IOTP Handler exists // IOTP Handler exists
} }
else else
{ {
// No IOTP Handler // No IOTP Handler
} }
NOTE: ActiveX is a trademark of Microsoft and was originally called NOTE: ActiveX is a trademark of Microsoft and was originally called
Sweeper. Sweeper.
[TBD Stuff about ActiveX glue...?]
5. ECML, The Electronic Commerce Modeling Language 5. ECML, The Electronic Commerce Modeling Language
A industry group has recently proposed a standard for fields used in A industry group has recently proposed a standard for fields used in
electronic commerce. This fields allow "wallet" software acting for electronic commerce. This fields allow "wallet" software acting for
the consumer to convey standardized information to a merchant, the consumer to convey standardized information to a merchant,
including information as to what payment related protocols are including information as to what payment related protocols are
supported at the customer site. See [ECML]. supported at the customer site. See [ECML].
6. Putting It All Together 6. Putting It All Together
skipping to change at page 6, line 30 skipping to change at page 5, line 35
| +----------------------+ | | +----------------------+ |
| YES | | | NO | | YES | | | NO |
|<-----------+ | +----------------->| |<-----------+ | +----------------->|
| V | | V |
remember | Indeterminate. remember | remember | Indeterminate. remember |
that |. Take default that type | that |. Take default that type |
type IS | action. is NOT | type IS | action. is NOT |
supported| supported | supported| supported |
X done X X done X
[...]
7. Future Development 7. Future Development
Active work is proceeding in the IETF, World Wide Web Consortium Active work is proceeding in the IETF, World Wide Web Consortium
[W3C], and Electronic Commerce Modeling Language Alliance [ECML] [W3C], and other standards and industry groups concerning content and
concerning content and capabilities negotiation. This work is likely capabilities negotiation. This work is likely to lead to superior
to lead to superior methods to implement the functionality described methods to implement the functionality described herein. However,
herein. However, near universal deployment of such new near universal deployment of such new standards/features will take
standards/features will take some time. Thus you should expect the some time. Thus you should expect the methods given herein to be
methods given herein to be obsoleted, but perhaps not for some years. obsoleted, but perhaps not for some time.
8. Security Considerations 8. Security Considerations
It should be noted that the variety of ActiveX control suggested It should be noted that the variety of ActiveX control suggested
above is reading the user's registry, that is, examining their above is reading the user's registry, that is, examining their
computer and reporting back some information it has discovered. This computer and reporting back some information it has discovered. This
may be a concern among some users. may be a concern among some users.
In general, the use of JavaScript even more so ActiveX is dangerous In general, the use of JavaScript and, even more so, ActiveX is
because they are so powerful. JavaScript or ActiveX from a web page dangerous because they are so powerful. JavaScript or ActiveX from a
could be invisibly damaging to the client. web page could be invisibly damaging to the client.
Security of web interactions is normally provided by adopting channel Security of web interactions is normally provided by adopting channel
encryption on the browser to server connections, such as [TLS]. In encryption on the browser to server connections, such as [TLS]. In
the absence of some such additional security outside of HTTP, the absence of some such additional security outside of HTTP,
requests and/or responses may be forged or tampered with. requests and/or responses may be forged or tampered with.
9. IANA Considerations 9. IANA Considerations
None specific to the techniques described herein. For MIME types and None specific to the techniques described herein. For MIME types and
type registration procedures, see [MIME: RFCs 2046, 2048]. type registration procedures, see [MIME: RFCs 2046, 2048].
References References
[ECML] <http://www.ecml.org> [ECML] Eastlake, D. and T. Goldstein, "ECML v1: Field Names for E-
RFC 2706 - "ECML v1: Field Names for E-Commerce", D. Eastlake, Commerce", RFC 2706, October 1999.
T. Goldstein, October 1999
draft-eastlake-ecom-fields2-*.txt, D. Eastlake, T. Goldstein.
[HTTP] RFC 1945 - "Hypertext Transfer Protocol -- HTTP/1.0", T. [HTTP] Berners-Lee, T., Fielding, R. and H. Frystyk, "Hypertext
Berners-Lee, R. Fielding & H. Frystyk. May 1996. Transfer Protocol -- HTTP/1.0", RFC 1945, May 1996.
RFC 2616 - "Hypertext Transfer Protocol -- HTTP/1.1", R.
Fielding, J. Gettys, J. Mogul, H. Frystyk, L. Masinter, P. Leach, T.
Berners-Lee. June 1999.
[IOTP] draft-ietf-trade-iotp-v1.0-protocol-*.txt - David Burdett, [HTTP] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter,
2000. L., Leach, P. and T. Berners-Lee, "Hypertext Transfer Protocol
-- HTTP/1.1", RFC 2616, June 1999.
[MIME] RFC 2045 - "Multipurpose Internet Mail Extensions (MIME) Part [IOTP] Burdett, D., "Internet Open Trading Protocol - IOTP Version
One: Format of Internet Message Bodies", N. Freed & N. Borenstein. 1.0", RFC 2801, April 2000.
November 1996.
RFC 2046 - "Multipurpose Internet Mail Extensions (MIME) Part
Two: Media Types", N. Freed & N. Borenstein. November 1996.
RFC 2047 - "MIME (Multipurpose Internet Mail Extensions) Part
Three: Message Header Extensions for Non-ASCII Text", K. Moore.
November 1996.
RFC 2048 - "Multipurpose Internet Mail Extensions (MIME) Part
Four: Registration Procedures", N. Freed, J. Klensin & J. Postel.
November 1996.
[SET] - "Secure Electronic Transaction (SET) Specification, Version [MIME] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
1.0", May 31, 1997, available from <http://www.setco.org>. Extensions (MIME) Part One: Format of Internet Message
Book 1: Business Description Bodies", RFC 2045, November 1996.
Book 2: Programmer's Guide
Book 3: Formal Protocol Definition
[TLS] RFC 2246 - "The TLS Protocol Version 1.0", T. Dierks, C. Allen. [MIME] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
Extensions (MIME) Part Two: Media Types", RFC 2046, November
1996.
[MIME] Moore, K., "MIME (Multipurpose Internet Mail Extensions) Part
Three: Message Header Extensions for Non-ASCII Text", RFC
2047, November 1996.
[MIME] Freed, N., Klensin, J. and J. Postel, "Multipurpose Internet
Mail Extensions (MIME) Part Four: Registration Procedures",
RFC 2048, November 1996.
[SET] "Secure Electronic Transaction (SET) Specification, Version
1.0", May 31, 1997, available from <http://www.setco.org>.
Book 1: Business Description
Book 2: Programmer's Guide
Book 3: Formal Protocol Definition
[TLS] Dierks, T. and C. Allen, "The TLS Protocol Version 1.0", RFC
2246, January 1999.
[W3C] World Wide Web Consortium, <www.w3.org> [W3C] World Wide Web Consortium, <www.w3.org>
Appendix A: Browser Version Sniffer Code Appendix A: Browser Version Sniffer Code
<SCRIPT LANGUAGE="JavaScript"> <SCRIPT LANGUAGE="JavaScript">
<!-- hide JavaScript from non-JavaScript browsers <!-- hide JavaScript from non-JavaScript browsers
//Ultimate client-side JavaScript client sniff. // Ultimate client-side JavaScript client sniff.
//(C)Netscape Communications 1998. Permission granted to reuse and distribute. // (C) Netscape Communications 1999.
//Revised 20 April 98 to add is.nav4up and is.ie4up (see below). // Permission granted to reuse and distribute.
// Revised 17 May 99 to add is_nav5up and is_ie5up (see below).
// Everything you always wanted to know about your JavaScript client // Everything you always wanted to know about your JavaScript client
// but were afraid to ask ... "Is" is the constructor function for "is" object, // but were afraid to ask. Creates "is_" variables indicating:
// which has properties indicating: // (1) browser vendor:
//(1) browser vendor: // is_nav, is_ie, is_opera
// is.nav, is.ie, is.opera // (2) browser version number:
//(2) browser version number: // is_major (integer indicating major version number: 2, 3, 4 ...)
// is.major (integer indicating major version number: 2, 3, 4 ...) // is_minor (float indicating full version number:
// is.minor (float indicating full version number: 2.02, 3.01, 4.04...) // 2.02, 3.01, 4.04 ...)
//(3) browser vendor AND major version number // (3) browser vendor AND major version number
// is.nav2, is.nav3, is.nav4, is.nav4up, is.ie3, is.ie4, is.ie4up // is_nav2, is_nav3, is_nav4, is_nav4up, is_nav5, is_nav5up,
//(4) JavaScript version number: // is_ie3, is_ie4, is_ie4up
// is.js (float indicating full JavaScript version number: 1, 1.1, 1.2...) // (4) JavaScript version number:
//(5) OS platform and version: // is_js (float indicating full JavaScript version number:
// is.win, is.win16, is.win32, is.win31, is.win95, is.winnt, is.win98 // 1, 1.1, 1.2 ...)
// is.os2 // (5) OS platform and version:
// is.mac, is.mac68k, is.macppc // is_win, is_win16, is_win32, is_win31,
// is.unix // is_win95, is_winnt, is_win98
// is.sun, is.sun4, is.sun5, is.suni86 // is_os2
// is.irix, is.irix5, is.irix6 // is_mac, is_mac68k, is_macppc
// is.hpux, is.hpux9, is.hpux10 // is_unix
// is.aix, is.aix1, is.aix2, is.aix3, is.aix4 // is_sun, is_sun4, is_sun5, is_suni86
// is.linux, is.sco, is.unixware, is.mpras, is.reliant // is_irix, is_irix5, is_irix6
// is.dec, is.sinix, is.freebsd, is.bsd // is_hpux, is_hpux9, is_hpux10
// is.vms // is_aix, is_aix1, is_aix2, is_aix3, is_aix4
// // is_linux, is_sco, is_unixware, is_mpras, is_reliant
//See http://www.it97.de/JavaScript/JS_tutorial/obj_hierarchy/navobjFr.html // is_dec, is_sinix, is_freebsd, is_bsd
//for a detailed list of userAgent strings. // is_vms
// //
//Note: you don't want your Nav4 or IE4 code to "turn off" or // See http://www.it97.de/JavaScript/JS_tutorial/bstat/navobj.html and
//stop working when Nav5 and IE5 (or later) are released, so // http://www.it97.de/JavaScript/JS_tutorial/bstat/Browseraol.html
//in conditional code forks, use is.nav4up ("Nav4 or greater") // for detailed lists of userAgent strings.
//and is.ie4up ("IE4 or greater") instead of is.nav4 or is.ie4 //
//to check version in code which you want to work on future // Note: you don't want your Nav4 or IE4 code to "turn off" or
//versions. // stop working when Nav5 and IE5 (or later) are released, so
// in conditional code forks, use is_nav4up ("Nav4 or greater")
// and is_ie4up ("IE4 or greater") instead of is_nav4 or is_ie4
// to check version in code which you want to work on future
// versions.
function Is () // convert all characters to lowercase to simplify testing
{ // convert all characters to lowercase to simplify testing var agt=navigator.userAgent.toLowerCase();
var agt=navigator.userAgent.toLowerCase()
// *** BROWSER VERSION *** // *** BROWSER VERSION ***
this.major = parseInt(navigator.appVersion) // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
this.minor = parseFloat(navigator.appVersion) var is_major = parseInt(navigator.appVersion);
this.nav = ((agt.indexOf('mozilla')!=-1) && var is_minor = parseFloat(navigator.appVersion);
((agt.indexOf('spoofer')==-1) &&
(agt.indexOf('compatible') == -1)))
this.nav2 = (this.nav && (this.major == 2))
this.nav3 = (this.nav && (this.major == 3))
this.nav4 = (this.nav && (this.major == 4))
this.nav4up = this.nav && (this.major >= 4)
this.navonly = (this.nav && (agt.indexOf(";nav") != -1))
this.ie = (agt.indexOf("msie") != -1) // Note: Opera and WebTV spoof Navigator. We do strict client
this.ie3 = (this.ie && (this.major == 2)) // detection. If you want to allow spoofing, take out the tests
this.ie4 = (this.ie && (this.major == 4)) // for opera and webtv.
this.ie4up = this.ie && (this.major >= 4) var is_nav = ((agt.indexOf('mozilla')!=-1)
&& (agt.indexOf('spoofer')==-1)
&& (agt.indexOf('compatible') == -1)
&& (agt.indexOf('opera')==-1)
&& (agt.indexOf('webtv')==-1));
var is_nav2 = (is_nav && (is_major == 2));
var is_nav3 = (is_nav && (is_major == 3));
var is_nav4 = (is_nav && (is_major == 4));
var is_nav4up = (is_nav && (is_major >= 4));
var is_navonly = (is_nav && ((agt.indexOf(";nav") != -1) ||
(agt.indexOf("; nav") != -1)) );
var is_nav5 = (is_nav && (is_major == 5));
var is_nav5up = (is_nav && (is_major >= 5));
this.opera = (agt.indexOf("opera") != -1) var is_ie = (agt.indexOf("msie") != -1);
var is_ie3 = (is_ie && (is_major < 4));
var is_ie4 = (is_ie && (is_major == 4)
&& (agt.indexOf("msie 5.0")==-1) );
var is_ie4up = (is_ie && (is_major >= 4));
var is_ie5 = (is_ie && (is_major == 4)
&& (agt.indexOf("msie 5.0")!=-1) );
var is_ie5up = (is_ie && !is_ie3 && !is_ie4);
// *** JAVASCRIPT VERSION CHECK *** // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
// Useful to workaround Nav3 bug in which Nav3 // or if this is the first browser window opened. Thus the
// loads <SCRIPT LANGUAGE="JavaScript1.2">. // variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.
if (this.nav2 || this.ie3) this.js = 1.0 var is_aol = (agt.indexOf("aol") != -1);
else if (this.nav3 || this.opera) this.js = 1.1 var is_aol3 = (is_aol && is_ie3);
else if (this.nav4 || this.ie4) this.js = 1.2 var is_aol4 = (is_aol && is_ie4);
// NOTE: In the future, update this code when newer versions of JS
// are released. For now, we try to provide some upward compatibility
// so that future versions of Nav and IE will show they are at
// *least* JS 1.2 capable. Always check for JS version compatibility
// with > or >=.
else if ((this.nav && (this.minor > 4.05)) || (this.ie && (this.major > 4)))
this.js = 1.2
else this.js = 0.0 // HACK: always check for JS version with > or >=
// *** PLATFORM *** var is_opera = (agt.indexOf("opera") != -1);
this.win = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) ) var is_webtv = (agt.indexOf("webtv") != -1);
// NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
// Win32, so you can't distinguish between Win95 and WinNT.
this.win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1))
// is this a 16 bit compiled version? // *** JAVASCRIPT VERSION CHECK ***
this.win16 = ((agt.indexOf("win16")!=-1) var is_js;
|| (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) if (is_nav2 || is_ie3) is_js = 1.0
|| (agt.indexOf("windows 16-bit")!=-1) ) else if (is_nav3 || is_opera) is_js = 1.1
this.win31 = (agt.indexOf("windows 3.1")!=-1) || else if ((is_nav4 && (is_minor <= 4.05)) || is_ie4) is_js = 1.2
(agt.indexOf("win16")!=-1) || else if ((is_nav4 && (is_minor > 4.05)) || is_ie5) is_js = 1.3
(agt.indexOf("windows 16-bit")!=-1) else if (is_nav5) is_js = 1.4
// NOTE: In the future, update this code when newer versions of JS
// are released. For now, we try to provide some upward compatibility
// so that future versions of Nav and IE will show they are at
// *least* JS 1.x capable. Always check for JS version compatibility
// with > or >=.
else if (is_nav && (is_major > 5)) is_js = 1.4
else if (is_ie && (is_major > 5)) is_js = 1.3
// HACK: no idea for other browsers;
// always check for JS version with > or >=
else is_js = 0.0;
// NOTE: Reliable detection of Win98 may not be possible. It appears that: // *** PLATFORM ***
// - On Nav 4.x and before you'll get plain "Windows" in userAgent. var is_win = ( (agt.indexOf("win")!=-1) ||
// - On Mercury client, the 32-bit version will return "Win98", but (agt.indexOf("16bit")!=-1) );
// the 16-bit version running on Win98 will still return "Win95". // NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4"
this.win98 = // on all Win32, so you can't distinguish between Win95 and WinNT.
((agt.indexOf("win98")!=-1)||(agt.indexOf("windows 98")!=-1)) var is_win95 = ((agt.indexOf("win95")!=-1) ||
this.winnt = (agt.indexOf("windows 95")!=-1));
((agt.indexOf("winnt")!=-1)||(agt.indexOf("windows nt")!=-1))
this.win32 = this.win95 || this.winnt || this.win98 ||
((this.major >= 4) && (navigator.platform == "Win32")) ||
(agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1)
this.os2 = (agt.indexOf("os/2")!=-1) // is this a 16 bit compiled version?
|| (navigator.appVersion.indexOf("OS/2")!=-1) var is_win16 = ((agt.indexOf("win16")!=-1) ||
|| (agt.indexOf("ibm-webexplorer")!=-1) (agt.indexOf("16bit")!=-1) ||
(agt.indexOf("windows 3.1")!=-1) ||
(agt.indexOf("windows 16-bit")!=-1) );
this.mac= (agt.indexOf("mac")!=-1) var is_win31 = ((agt.indexOf("windows 3.1")!=-1) ||
this.mac68k = this.mac && ((agt.indexOf("68k")!=-1) || (agt.indexOf("win16")!=-1) ||
(agt.indexOf("68000")!=-1)) (agt.indexOf("windows 16-bit")!=-1));
this.macppc = this.mac && ((agt.indexOf("ppc")!=-1) ||
(agt.indexOf("powerpc")!=-1))
this.sun = (agt.indexOf("sunos")!=-1)
this.sun4 = (agt.indexOf("sunos 4")!=-1)
this.sun5 = (agt.indexOf("sunos 5")!=-1)
this.suni86= this.sun && (agt.indexOf("i86")!=-1)
this.irix = (agt.indexOf("irix") !=-1) // SGI
this.irix5 = (agt.indexOf("irix 5") !=-1)
this.irix6 =
((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6")!=-1))
this.hpux = (agt.indexOf("hp-ux")!=-1)
this.hpux9 = this.hpux && (agt.indexOf("09.")!=-1)
this.hpux10= this.hpux && (agt.indexOf("10.")!=-1)
this.aix = (agt.indexOf("aix") !=-1) // IBM
this.aix1 = (agt.indexOf("aix 1") !=-1)
this.aix2 = (agt.indexOf("aix 2") !=-1)
this.aix3 = (agt.indexOf("aix 3") !=-1)
this.aix4 = (agt.indexOf("aix 4") !=-1)
this.linux = (agt.indexOf("inux")!=-1)
this.sco = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1)
this.unixware = (agt.indexOf("unix_system_v")!=-1)
this.mpras= (agt.indexOf("ncr")!=-1)
this.reliant = (agt.indexOf("reliantunix")!=-1)
this.dec =
(agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1)
|| (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1)
|| (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1)
this.sinix = (agt.indexOf("sinix")!=-1)
this.freebsd = (agt.indexOf("freebsd")!=-1)
this.bsd = (agt.indexOf("bsd")!=-1)
this.unix =
(agt.indexOf("x11")!=-1) || this.sun || this.irix || this.hpux ||
this.sco ||this.unixware || this.mpras || this.reliant ||
this.dec || this.sinix || this.aix || this.linux || this.freebsd
this.vms = (agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1) // NOTE: Reliable detection of Win98 may not be possible.
} // It appears that:
// - On Nav 4.x and before you'll get plain "Windows" in userAgent.
// - On Mercury client, the 32-bit version will return "Win98", but
// the 16-bit version running on Win98 will still return "Win95".
var is_win98 = ((agt.indexOf("win98")!=-1) ||
(agt.indexOf("windows 98")!=-1));
var is_winnt = ((agt.indexOf("winnt")!=-1) ||
(agt.indexOf("windows nt")!=-1));
var is_win32 = (is_win95 || is_winnt || is_win98 ||
((is_major >= 4) &&
(navigator.platform == "Win32")) ||
(agt.indexOf("win32")!=-1) ||
(agt.indexOf("32bit")!=-1));
var is; var is_os2 = ((agt.indexOf("os/2")!=-1) ||
var isIE3Mac = false; (navigator.appVersion.indexOf("OS/2")!=-1) ||
// this section is designed specifically for IE3 for the Mac (agt.indexOf("ibm-webexplorer")!=-1));
if ((navigator.appVersion.indexOf("Mac")!=-1) &&
(navigator.userAgent.indexOf("MSIE")!=-1) &&
(parseInt(navigator.appVersion)==3))
isIE3Mac = true;
else
is = new Is();
//--> end hide JavaScript
</SCRIPT>
Authors Addresses var is_mac = (agt.indexOf("mac")!=-1);
var is_mac68k = (is_mac && ((agt.indexOf("68k")!=-1) ||
(agt.indexOf("68000")!=-1)));
var is_macppc = (is_mac && ((agt.indexOf("ppc")!=-1) ||
(agt.indexOf("powerpc")!=-1)));
var is_sun = (agt.indexOf("sunos")!=-1);
var is_sun4 = (agt.indexOf("sunos 4")!=-1);
var is_sun5 = (agt.indexOf("sunos 5")!=-1);
var is_suni86= (is_sun && (agt.indexOf("i86")!=-1));
var is_irix = (agt.indexOf("irix") !=-1); // SGI
var is_irix5 = (agt.indexOf("irix 5") !=-1);
var is_irix6 = ((agt.indexOf("irix 6") !=-1) ||
(agt.indexOf("irix6") !=-1));
var is_hpux = (agt.indexOf("hp-ux")!=-1);
var is_hpux9 = (is_hpux && (agt.indexOf("09.")!=-1));
var is_hpux10= (is_hpux && (agt.indexOf("10.")!=-1));
var is_aix = (agt.indexOf("aix") !=-1); // IBM
var is_aix1 = (agt.indexOf("aix 1") !=-1);
var is_aix2 = (agt.indexOf("aix 2") !=-1);
var is_aix3 = (agt.indexOf("aix 3") !=-1);
var is_aix4 = (agt.indexOf("aix 4") !=-1);
var is_linux = (agt.indexOf("inux")!=-1);
var is_sco = (agt.indexOf("sco")!=-1) ||
(agt.indexOf("unix_sv")!=-1);
var is_unixware = (agt.indexOf("unix_system_v")!=-1);
var is_mpras = (agt.indexOf("ncr")!=-1);
var is_reliant = (agt.indexOf("reliantunix")!=-1);
var is_dec = ((agt.indexOf("dec")!=-1) ||
(agt.indexOf("osf1")!=-1) ||
(agt.indexOf("dec_alpha")!=-1) ||
(agt.indexOf("alphaserver")!=-1) ||
(agt.indexOf("ultrix")!=-1) ||
(agt.indexOf("alphastation")!=-1));
var is_sinix = (agt.indexOf("sinix")!=-1);
var is_freebsd = (agt.indexOf("freebsd")!=-1);
var is_bsd = (agt.indexOf("bsd")!=-1);
var is_unix = ((agt.indexOf("x11")!=-1) || is_sun ||
is_irix || is_hpux ||
is_sco ||is_unixware || is_mpras || is_reliant ||
is_dec || is_sinix || is_aix || is_linux ||
is_bsd || is_freebsd);
var is_vms = ((agt.indexOf("vax")!=-1) ||
(agt.indexOf("openvms")!=-1));
</SCRIPT>
Authors' Addresses
Donald E. Eastlake 3rd Donald E. Eastlake 3rd
Motorola Motorola
65 Shindegan Hill Road 140 Forest Avenue
Carmel, NY 10512 USA Hudson, MA 01749 USA
Telephone: +1 914-276-2668(h) Phone: +1 978-562-2827(h)
+1 508-261-5434(w) +1 508-261-5434(w)
FAX: +1 508-261-4447(w) Fax: +1 508-261-4447(w)
email: Donald.Eastlake@motorola.com EMail: Donald.Eastlake@motorola.com
Chris J. Smith Chris J. Smith
Royal Bank of Canada Royal Bank of Canada
277 Front Street West 277 Front Street West
Toronto, Ontario M5V 3A4 CANADA Toronto, Ontario M5V 3A4 CANADA
Telephone: +1 416-348-6090 Phone: +1 416-348-6090
FAX: +1 416-348-2210 Fax: +1 416-348-2210
email: chris.smith@royalbank.com EMail: chris.smith@royalbank.com
David M. Soroka David M. Soroka
IBM IBM
Raleigh, NC Raleigh, NC
Telephone: +1 919-486-2684 Phone: +1 919-486-2684
Fax: +1 919-543-4653 Fax: +1 919-543-4653
email: dsoroka@us.ibm.com EMail: dsoroka@us.ibm.com
Expiration and File Name Full Copyright Statement
This draft expires September 2000. Copyright (C) The Internet Society (2000). All Rights Reserved.
Its file name is draft-ietf-trade-mime-detector-02.txt. This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement
Funding for the RFC Editor function is currently provided by the
Internet Society.
 End of changes. 54 change blocks. 
285 lines changed or deleted 298 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/