B2G/gecko/content/base/src/CSPUtils.jsm
/**
   * Copies default source list to each unspecified directive.
   * @returns
   *      true  if the makeExplicit succeeds
   *      false if it fails (for some weird reason)
   */
Copies default source list to each unspecified directive.
@returns
true  if the makeExplicit succeeds
false if it fails (for some weird reason)
Copies default source list to each unspecified directive . @returns true if the makeExplicit succeeds false if it fails ( for some weird reason )
function cspsd_makeExplicit() {
    var SD = CSPRep.SRC_DIRECTIVES;
    var defaultSrcDir = this._directives[SD.DEFAULT_SRC];
    if (!defaultSrcDir) {
      this.warn(CSPLocalizer.getStr("allowOrDefaultSrcRequired"));
      return false;
    }
    for (var dir in SD) {
      var dirv = SD[dir];
      if (dirv === SD.DEFAULT_SRC) continue;
      if (!this._directives[dirv]) {
        if (dirv === SD.FRAME_ANCESTORS)
          this._directives[dirv] = CSPSourceList.fromString("*",this);
        else
          this._directives[dirv] = defaultSrcDir.clone();
        this._directives[dirv]._isImplicit = true;
      }
    }
    this._isInitialized = true;
    return true;
  }
function cspsd_makeExplicit ( ) { var SD = CSPRep . SRC_DIRECTIVES ; var defaultSrcDir = this . _directives [ SD . DEFAULT_SRC ] ; if ( ! defaultSrcDir ) { this . warn ( CSPLocalizer . getStr ( "allowOrDefaultSrcRequired" ) ) ; return false ; } for ( var dir in SD ) { var dirv = SD [ dir ] ; if ( dirv === SD . DEFAULT_SRC ) continue ; if ( ! this . _directives [ dirv ] ) { if ( dirv === SD . FRAME_ANCESTORS ) this . _directives [ dirv ] = CSPSourceList . fromString ( "*" , this ) ; else this . _directives [ dirv ] = defaultSrcDir . clone ( ) ; this . _directives [ dirv ] . _isImplicit = true ; } } this . _isInitialized = true ; return true ; }
Copies default source list to each unspecified directive.
Copies default source list to each unspecified directive .
// implicit directive, make explicit. // All but frame-ancestors directive inherit from 'allow' (bug 555068)