lighthouse-plugin-publisher-ads/audits/script-injected-tags.js
/**
 * Checks if the given record was initiated by an inline script with
 * dependencies on any other resource.
 * That is, the record was initiated by another script insert a <script> tag
 * into the DOM using doc.write or body.appendChild, for example.
 * @param {NetworkRequest} record
 * @return {boolean}
 */
Checks if the given record was initiated by an inline script with
dependencies on any other resource.
That is, the record was initiated by another script insert a .
@param {NetworkRequest} record
@return {boolean}
Checks if the given record was initiated by an inline script with dependencies on any other resource . That is the record was initiated by another script insert a . @param { NetworkRequest } record @return { boolean }
function initiatedByInlineScript(record) {
  if (record.initiator.type !== 'script') {
    return false;
  }
  const initiators = PageDependencyGraph.getNetworkInitiators(record);
  if (initiators.length !== 1 || initiators[0] !== record.documentURL) {
    return false;
  }
  return true;
}
function initiatedByInlineScript ( record ) { if ( record . initiator . type !== 'script' ) { return false ; } const initiators = PageDependencyGraph . getNetworkInitiators ( record ) ; if ( initiators . length !== 1 || initiators [ 0 ] !== record . documentURL ) { return false ; } return true ; }
Checks if the given record was initiated by an inline script with
 dependencies on any other resource.
Checks if the given record was initiated by an inline script with dependencies on any other resource .
// Initiated by some other means, e.g. preload link or static script tag. // Depends on some other script.