Notification when Safari loads URL

My script in Xcode needs to get notified when Safari opens new URL.