TEST

headタグにimgタグをHTMLで静的に入れたサンプル

下記のスクリプトをChromeのConsoleで実行してください。

{
  const headInnerTags = [...new Set($$('head *').map(el => el.localName))];
  const checkTags = ['title', 'meta', 'link', 'script', 'style', 'base', 'noscript', 'template'];
  const errorTags = [];
  console.log(headInnerTags);
  headInnerTags.forEach(tag => {
    if (!checkTags.includes(tag)) {
      errorTags.push(tag);
    }
  });
  if (errorTags.length) {
    console.error(`${errorTags}はhead内で無効なタグです。`);
  } else {
    console.log('head内で無効なタグはありませんでした。');
  }
}

元記事を表示する