title: jQuery seems to not be loaded when using Chrome Web Console
body: <p>The following script run successfully via the Chrome Web Console for months is suddenly not working.  </p>
  
  <pre><code>// Override site's disabling of the console.log function
  console.log = console.__proto__.log
  
  // get the DOM ready to process
  $(document).ready()
  function doThisThing(){
    window._waitWindow = setInterval(function(){
  
      // start looking for items not 'ready to go'
      items = $("div.Catalogitem-content");
      $.each(items, function(index){
  
             if($(items[index]).find(".Catalogitem-stager").text().includes("ready to go") || index &lt; lastitemCount){
                $(this).css("background-color", "#84f784");
              } else {
                  $(this).css("background-color", "#ff7089");
                  $(this).find(".engage-cycle-btn").click();
                }
           });
          window.scrollTo(0, document.body.scrollHeight);
      }, 10000);
    return window._waitWindow;
  }
  
  function stopit() {
    clearInterval(window._waitWindow);
    console.log("Just executed clearInterval.");
  }
  </code></pre>
  
  <p>The error thrown is:</p>
  
  <blockquote>
    <p>Uncaught DOMException: Failed to execute 'querySelector' on 'Document': '[object HTMLDocument]' is not a valid selector.</p>
  </blockquote>
  
  <p>The offending line is:</p>
  
  <blockquote>
    <p>$(document).ready()</p>
  </blockquote>
  
  <p>Actions I took:</p>
  
  <ol>
  <li>I checked to see if jQuery had been loaded properly.  The results of the following commands led me to believe jQuery wasn't loaded properly... maybe I'm wrong?</li>
  </ol>
  
  <hr>
  
  <p><strong>Command 1</strong></p>
  
  <pre><code>$(document).ready(function($){ });
  </code></pre>
  
  <blockquote>
    <p>Uncaught DOMException: Failed to execute 'querySelector' on
    'Document': '[object HTMLDocument]' is not a valid selector.</p>
  </blockquote>
  
  <p><strong>Command 2</strong></p>
  
  <pre><code>console.log($())
  </code></pre>
  
  <blockquote>
    <p>null</p>
  </blockquote>
  
  <p><strong>Command 3</strong></p>
  
  <pre><code>$().jquery
  </code></pre>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'jquery' of null(…)</p>
  </blockquote>
  
  <p><strong>Command 4</strong></p>
  
  <pre><code>jQuery.jquery
  </code></pre>
  
  <blockquote>
    <p>Uncaught ReferenceError: jQuery is not defined(…)</p>
  </blockquote>
  
  <p><strong>Command 5</strong></p>
  
  <pre><code>$('.class');
  </code></pre>
  
  <blockquote>
    <p>null</p>
  </blockquote>
  
  <hr>
  
  <ol start="2">
  <li><p>Tried to load jQuery by running the following code in the Web Browser:</p>
  
  <p>var jq = document.createElement('script');
  jq.src = "<a href="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" rel="nofollow">https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js</a>";
  document.getElementsByTagName('head')[0].appendChild(jq);</p></li>
  </ol>
  
  <p>Got this error:  </p>
  
  <blockquote>
    <p>VM711:3 Refused to load the script
    '<a href="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" rel="nofollow">https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js</a>'
    because it violates the following Content Security Policy directive:
    blah blah blah.</p>
  </blockquote>
  
  <p>Been combing the internet for a solution, but feel I'm in a deep rabbit hole.
  Is it that jquery's not loaded?
  Is it that the site I'm processing data from has added a new layer of security to thwart my automation?</p>
  
  <p>I'm at a loss.  Thanks in advance.</p>