 	constructor: (@owner) ->
 		@className = "PhantomBrowserController"
 
+	CompleteAction: ( response ) ->
+		response = {} if not response
+		response.Response = "ActionCompleted"
+		response.Url = page.evaluate -> window.location.href
+		@owner.socket.send JSON.stringify response
+
 	# Commands
 	Navigate: (command) ->
 		url = command.url
 
 		page.onLoadFinished = (status) =>
 			@IncludeJQuery()
-			@owner.socket.send JSON.stringify({ Response: "ActionCompleted" })
+			@CompleteAction()
 
 		page.open url
 

		console.log "Waiting #{milliseconds} milliseconds"
		fn = =>
			console.log "Wait complete"
			@owner.socket.send JSON.stringify({ Response: "ActionCompleted" })
		setInterval fn, milliseconds

	Press: (keys) ->

		page.sendEvent 'mousemove', dstOffset.left, dstOffset.top
		page.sendEvent 'mouseup', dstOffset.left, dstOffset.top

		@CompleteAction()

	SelectText: (command) ->
		selector = command.selector if command.selector?
