B2G/gecko/browser/components/feeds/src/WebContentConverter.js
/**
   * Determines if a web handler is already registered.
   *
   * @param aProtocol
   *        The scheme of the web handler we are checking for.
   * @param aURITemplate
   *        The URI template that the handler uses to handle the protocol.
   * @return true if it is already registered, false otherwise.
   */
Determines if a web handler is already registered.
@param aProtocol
The scheme of the web handler we are checking for.
@param aURITemplate
The URI template that the handler uses to handle the protocol.
@return true if it is already registered, false otherwise.
Determines if a web handler is already registered . @param aProtocol The scheme of the web handler we are checking for . @param aURITemplate The URI template that the handler uses to handle the protocol . @return true if it is already registered false otherwise .
function WCCR_protocolHandlerRegistered(aProtocol, aURITemplate) {
    var eps = Cc["@mozilla.org/uriloader/external-protocol-service;1"].
              getService(Ci.nsIExternalProtocolService);
    var handlerInfo = eps.getProtocolHandlerInfo(aProtocol);
    var handlers =  handlerInfo.possibleApplicationHandlers;
    for (let i = 0; i < handlers.length; i++) {
      try { 
        let handler = handlers.queryElementAt(i, Ci.nsIWebHandlerApp);
        if (handler.uriTemplate == aURITemplate)
          return true;
      } catch (e) {  }
    }
    return false;
  }
function WCCR_protocolHandlerRegistered ( aProtocol , aURITemplate ) { var eps = Cc [ "@mozilla.org/uriloader/external-protocol-service;1" ] . getService ( Ci . nsIExternalProtocolService ) ; var handlerInfo = eps . getProtocolHandlerInfo ( aProtocol ) ; var handlers = handlerInfo . possibleApplicationHandlers ; for ( let i = 0 ; i < handlers . length ; i ++ ) { try { let handler = handlers . queryElementAt ( i , Ci . nsIWebHandlerApp ) ; if ( handler . uriTemplate == aURITemplate ) return true ; } catch ( e ) { } } return false ; }
Determines if a web handler is already registered.
Determines if a web handler is already registered .
// We only want to test web handlers /* it wasn't a web handler */