title: How to wp_add_inline_script when there's no registered script to hook onto?
body: <p>The docs for <code>wp_add_inline_script</code> state that it:</p>
  
  <blockquote>
    <p>Adds extra code to a registered script.</p>
  </blockquote>
  
  <p>How do you do it when there is no registered script?  In my case, my only registered JS is before the closing <code>body</code> tag, and I want an inline script (js detection) in the head.  Specifically I want my inline JS to come before my styles, but after the <code>&lt;title&gt;</code> and <code>&lt;meta&gt;</code> tags.</p>
  
  <p>I tried to enqueue an empty script and then use it to hook my inline script onto, but that didn't work.  Like this:</p>
  
  <pre><code>wp_enqueue_script( 'theme-js-detection', null, array(), null, false);
  
  wp_add_inline_script( 'theme-js-detection', 
      '(function(H){H.className=H.className.replace(/\bno-js\b/,"js")})(document.documentElement)' 
  );
  </code></pre>
  
  <p>Can this be done?</p>