title: getCurrentTime() for YouTube Video
body: <p>I'm writing a Chrome Extension in Javascript and I want to get the current time for the playing video on youtube.com. I tried using the answer from question <a href="https://stackoverflow.com/questions/6970013">Getting Current YouTube Video Time</a> , e.g.:</p>
  <blockquote>
  <p>ytplayer = document.getElementById(&quot;movie_player&quot;);</p>
  <p>ytplayer.getCurrentTime();</p>
  </blockquote>
  <p>However I do get following error: &quot;Uncaught TypeError: Cannot read property 'getCurrentTime' of null&quot;;</p>
  <p>What I am doing wrong? I tried different values for the ElementId - movie_player, player....</p>
  <p>Any help is appreciated. Thanks in advance.</p>
  <p>Cheers.</p>
  <p>edit:</p>
  <p>Here is my manifest:</p>
  <pre><code>{
    &quot;manifest_version&quot;: 2,
  
    &quot;name&quot;: &quot;&quot;,
    &quot;description&quot;: &quot;&quot;,
    &quot;version&quot;: &quot;1.0&quot;,
  
    &quot;browser_action&quot;: {
      &quot;default_icon&quot;: &quot;icon.png&quot;,
      &quot;default_popup&quot;: &quot;basic.html&quot;
    },
    &quot;permissions&quot;: [
      &quot;tabs&quot;,
      &quot;activeTab&quot;, &quot;http://*/*&quot;, &quot;https://*/*&quot;
    ]
  }
  </code></pre>
  <p>Another thing is:
  If I execute this code:</p>
  <pre><code>ytplayer = document.getElementById(&quot;movie_player&quot;);
  
  ytplayer.getCurrentTime();
  </code></pre>
  <p>In the Javascript console on a Youtube Page it works fine and returns the current time.
  If, however I execute this value from the extension or the console of the extension, the first line return value null.</p>
  <p>So, as Ben assumed below, the issue seems to be that my extension doesn't even access the Youtube page.</p>
  <p>Any help is appreciated, so thanks in advance.</p>
  <p>Cheers</p>