msProtocols property

[This documentation is preliminary and is subject to change.]

This member is not supported and should not be used. Determines if a specified protocol has an associated protocol handler.

This property is read-only.

Internet Explorer 10

Syntax

JavaScript
ptr = object.msProtocols

Property values

Type: MSProtocolsCollection

Remarks

This property allows web developers to detect if a specified protocol has an associated protocol handler application.

One possible use is determining if a local application can be used to process data associated with the given protocol, such as determining if a local video viewer can be used instead of the online version.


if (navigator.msProtocols["myProtocol"] === undefined) {
  // The "myProtocol://" protocol does not have a handler.
}

if (navigator.msProtocols["myProtocol"]) {
  // The "myProtocol://" protocol has a handler.
}

if (navigator.msProtocols["myProtocol"]) {
  location.href = "myProtocol://<Some path under the myProtocol protocol>";
} else {
 // Fallback code for when the "myProtocol" protocol doesn’t exist.
}


Note  Currently, you cannot iterate through the objects in the msProtocols "array."

The object returned from the msProtocols "array" has one property - protocol.

See also

navigator

 

 

Send comments about this topic to Microsoft

Build date: 6/7/2012

Community Additions

Show:
© 2014 Microsoft