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