Swift code to target Safari address bar

Is there any function that returns when the user hits enter on the safari address bar? Is there any way to tell where the user searched using the address bar. I am trying to implement this in a Safari App Extension.
Swift code to target Safari address bar
 
 
Q