code: function addScriptUrlsByHeaderInsertion(html, missingScriptUrls) {
    const escapedPlaceholder = new RegExp('([^\\S\\r\\n]*)'
        + escapeRegex('</head>'), 'i');
  
    const indentedUrls = Array.from(missingScriptUrls).map((u) => '  ' + u);
    indentedUrls.push('</head>');
    whitespaceUrls = indentedUrls.map((u) => '$1' + u);
    return html.replace(escapedPlaceholder, whitespaceUrls.join('\n'));
  }
docs: Inserts <script> tags into the <head> of an HTML document.
  
  @param {string} html The HTML document.
  @param {Array.<string>} missingScriptUrls The list of <script> elements.
  @return {string} The substituted HTML.