Is that a bug on Safari? Version 8 (the older also)
When the user enters URL into the address bar and hit enter or clicks bookmark the 'beforeNavigate' event is not catched. But it works if open a link on a webpage. Any idea how to get initial requested URL? Sample code:
//global.html
<!DOCTYPE HTML>
<script>
safari.application.addEventListener("beforeNavigate", openHandler, true);
function openHandler(e) { console.log(e); }
</script>