title: Safari Extension safari.application error
body: <p>I'm making an extension for safari I created a context item with command = <code>showNote</code></p>
  
  <p>In debugger I get the follwing error <code>TypeError: Result of expression 'safari.application' [undefined] is not an object</code> on line 8(the last line) </p>
  
  <p>are there any things you need to include or call before this works?</p>
  
  <p>main.js</p>
  
  <pre><code>function showNote(event){
      if(event.command == "showNote"){
          addElement = document.createElement('&lt;div id="safExtNote"&gt;&lt;textarea id="safExtNoteText"&gt;&lt;/textarea&gt;&lt;button id="safExtSave"&gt;Save&lt;/safExtNote&gt;&lt;/div&gt;');
          document.body.appendChild(addElement)
          alert("im online");
      }
  }
  safari.application.addEventListener("command", showNote, false);
  </code></pre>