function displayNELPolicyDetail_(nelInfo) {
    // Clear the existing content.
    $(ReportingView.NEL_POLICIES_TBODY_ID).innerHTML = '';

    var disabled = (nelInfo === undefined);
    setNodeDisplay($(ReportingView.NEL_POLICIES_DISABLED_ID), disabled);
    if (disabled) {
      setNodeDisplay($(ReportingView.NEL_POLICIES_EMPTY_ID), false);
      setNodeDisplay($(ReportingView.NEL_POLICIES_TABLE_ID), false);
      return;
    }

    nelInfo = ensureObject_(nelInfo);
    var policies = ensureArray_(nelInfo.originPolicies);
    var empty = policies.length == 0;
    setNodeDisplay($(ReportingView.NEL_POLICIES_EMPTY_ID), empty);
    setNodeDisplay($(ReportingView.NEL_POLICIES_TABLE_ID), !empty);
    if (empty)
      return;

    for (var i = 0; i < policies.length; ++i) {
      var policy = ensureObject_(policies[i]);
      var tr = addNode($(ReportingView.NEL_POLICIES_TBODY_ID), 'tr');

      addNodeWithText(tr, 'td', policy.origin);

      var subdomainsNode = addNode(tr, 'td');
      subdomainsNode.classList.add('reporting-centered');
      addTextNode(subdomainsNode, !!policy.includeSubdomains ? 'yes' : 'no');

      var expiresNode = addNode(tr, 'td');
      if (policy.expires !== undefined) {
        var expiresDate = timeutil.convertTimeTicksToDate(policy.expires);
        timeutil.addNodeWithDate(expiresNode, expiresDate);
        if (expired_(expiresDate)) {
          var expiredSpan = addNode(expiresNode, 'span');
          expiredSpan.classList.add('warning-text');
          addTextNode(expiredSpan, ' [expired]');
        }
      }

      addNodeWithText(tr, 'td', policy.reportTo);

      var successFractionNode = addNode(tr, 'td');
      successFractionNode.classList.add('reporting-right-justified');
      addTextNode(successFractionNode, percent_(policy.successFraction));

      var failureFractionNode = addNode(tr, 'td');
      failureFractionNode.classList.add('reporting-right-justified');
      addTextNode(failureFractionNode, percent_(policy.failureFraction));
    }
  }
/**
   * Displays information about each origin that has provided NEL headers.
   */
Displays information about each origin that has provided NEL headers.
Displays information about each origin that has provided NEL headers .
function displayNELPolicyDetail_(nelInfo) {
    $(ReportingView.NEL_POLICIES_TBODY_ID).innerHTML = '';
    var disabled = (nelInfo === undefined);
    setNodeDisplay($(ReportingView.NEL_POLICIES_DISABLED_ID), disabled);
    if (disabled) {
      setNodeDisplay($(ReportingView.NEL_POLICIES_EMPTY_ID), false);
      setNodeDisplay($(ReportingView.NEL_POLICIES_TABLE_ID), false);
      return;
    }
    nelInfo = ensureObject_(nelInfo);
    var policies = ensureArray_(nelInfo.originPolicies);
    var empty = policies.length == 0;
    setNodeDisplay($(ReportingView.NEL_POLICIES_EMPTY_ID), empty);
    setNodeDisplay($(ReportingView.NEL_POLICIES_TABLE_ID), !empty);
    if (empty)
      return;
    for (var i = 0; i < policies.length; ++i) {
      var policy = ensureObject_(policies[i]);
      var tr = addNode($(ReportingView.NEL_POLICIES_TBODY_ID), 'tr');
      addNodeWithText(tr, 'td', policy.origin);
      var subdomainsNode = addNode(tr, 'td');
      subdomainsNode.classList.add('reporting-centered');
      addTextNode(subdomainsNode, !!policy.includeSubdomains ? 'yes' : 'no');
      var expiresNode = addNode(tr, 'td');
      if (policy.expires !== undefined) {
        var expiresDate = timeutil.convertTimeTicksToDate(policy.expires);
        timeutil.addNodeWithDate(expiresNode, expiresDate);
        if (expired_(expiresDate)) {
          var expiredSpan = addNode(expiresNode, 'span');
          expiredSpan.classList.add('warning-text');
          addTextNode(expiredSpan, ' [expired]');
        }
      }
      addNodeWithText(tr, 'td', policy.reportTo);
      var successFractionNode = addNode(tr, 'td');
      successFractionNode.classList.add('reporting-right-justified');
      addTextNode(successFractionNode, percent_(policy.successFraction));
      var failureFractionNode = addNode(tr, 'td');
      failureFractionNode.classList.add('reporting-right-justified');
      addTextNode(failureFractionNode, percent_(policy.failureFraction));
    }
  }
function displayNELPolicyDetail_ ( nelInfo ) { $ ( ReportingView . NEL_POLICIES_TBODY_ID ) . innerHTML = '' ; var disabled = ( nelInfo === undefined ) ; setNodeDisplay ( $ ( ReportingView . NEL_POLICIES_DISABLED_ID ) , disabled ) ; if ( disabled ) { setNodeDisplay ( $ ( ReportingView . NEL_POLICIES_EMPTY_ID ) , false ) ; setNodeDisplay ( $ ( ReportingView . NEL_POLICIES_TABLE_ID ) , false ) ; return ; } nelInfo = ensureObject_ ( nelInfo ) ; var policies = ensureArray_ ( nelInfo . originPolicies ) ; var empty = policies . length == 0 ; setNodeDisplay ( $ ( ReportingView . NEL_POLICIES_EMPTY_ID ) , empty ) ; setNodeDisplay ( $ ( ReportingView . NEL_POLICIES_TABLE_ID ) , ! empty ) ; if ( empty ) return ; for ( var i = 0 ; i < policies . length ; ++ i ) { var policy = ensureObject_ ( policies [ i ] ) ; var tr = addNode ( $ ( ReportingView . NEL_POLICIES_TBODY_ID ) , 'tr' ) ; addNodeWithText ( tr , 'td' , policy . origin ) ; var subdomainsNode = addNode ( tr , 'td' ) ; subdomainsNode . classList . add ( 'reporting-centered' ) ; addTextNode ( subdomainsNode , ! ! policy . includeSubdomains ? 'yes' : 'no' ) ; var expiresNode = addNode ( tr , 'td' ) ; if ( policy . expires !== undefined ) { var expiresDate = timeutil . convertTimeTicksToDate ( policy . expires ) ; timeutil . addNodeWithDate ( expiresNode , expiresDate ) ; if ( expired_ ( expiresDate ) ) { var expiredSpan = addNode ( expiresNode , 'span' ) ; expiredSpan . classList . add ( 'warning-text' ) ; addTextNode ( expiredSpan , ' [expired]' ) ; } } addNodeWithText ( tr , 'td' , policy . reportTo ) ; var successFractionNode = addNode ( tr , 'td' ) ; successFractionNode . classList . add ( 'reporting-right-justified' ) ; addTextNode ( successFractionNode , percent_ ( policy . successFraction ) ) ; var failureFractionNode = addNode ( tr , 'td' ) ; failureFractionNode . classList . add ( 'reporting-right-justified' ) ; addTextNode ( failureFractionNode , percent_ ( policy . failureFraction ) ) ; } }
Displays information about each origin that has provided NEL headers.
Displays information about each origin that has provided NEL headers .
// Clear the existing content.