title: document.getElementsByClassName(...)[0] is undefined in GM script, works in JS
body: <p>I am trying to use this line of JavaScript as a GreaseMonkey script:</p>
  
  <pre><code>javascript: document.getElementsByClassName("widget-contents")[0].style.height='640px';void(0);
  </code></pre>
  
  <p>I tried to convert it into a GreaseMonkey script as such:</p>
  
  <pre><code>// ==UserScript==
  // @name        First GM Script
  // @namespace   http://www.example.net/
  // @description first gm script
  // @include     https//www.example.net/*
  // @version     1
  // @grant       none
  // ==/UserScript==
  document.getElementsByClassName('widget-contents') [0].style.height = '640px';
  </code></pre>
  
  <p>and I am getting this error:</p>
  
  <pre><code>document.getElementsByClassName(...)[0] is undefined
  </code></pre>
  
  <p>Could someone explain to me what am I doing wrong?</p>