B2G/gecko/content/base/src/CSPUtils.jsm
/**
   * Determines if this policy accepts a URI.
   * @param aContext
   *        one of the SRC_DIRECTIVES defined above
   * @returns
   *        true if the policy permits the URI in given context.
   */
Determines if this policy accepts a URI.
@param aContext
one of the SRC_DIRECTIVES defined above
@returns
true if the policy permits the URI in given context.
Determines if this policy accepts a URI . @param aContext one of the SRC_DIRECTIVES defined above @returns true if the policy permits the URI in given context .
function csp_permits(aURI, aContext) {
    if (!aURI) return false;
    if (aURI instanceof String && aURI.substring(0,6) === "about:")
      return true;
    if (aURI instanceof Ci.nsIURI && aURI.scheme === "about")
      return true;
    for (var i in CSPRep.SRC_DIRECTIVES) {
      if (CSPRep.SRC_DIRECTIVES[i] === aContext) {
        return this._directives[aContext].permits(aURI);
      }
    }
    return false;
  }
function csp_permits ( aURI , aContext ) { if ( ! aURI ) return false ; if ( aURI instanceof String && aURI . substring ( 0 , 6 ) === "about:" ) return true ; if ( aURI instanceof Ci . nsIURI && aURI . scheme === "about" ) return true ; for ( var i in CSPRep . SRC_DIRECTIVES ) { if ( CSPRep . SRC_DIRECTIVES [ i ] === aContext ) { return this . _directives [ aContext ] . permits ( aURI ) ; } } return false ; }
Determines if this policy accepts a URI.
Determines if this policy accepts a URI .
// GLOBALLY ALLOW "about:" SCHEME // make sure the context is valid