lib/capybara/poltergeist/client/browser.coffee in poltergeist-1.8.0 vs lib/capybara/poltergeist/client/browser.coffee in poltergeist-1.8.1
- old
+ new
@@ -52,10 +52,12 @@
@page.onPageCreated = (newPage) =>
page = new Poltergeist.WebPage(newPage)
page.handle = "#{@_counter++}"
@pages.push(page)
+ return
+
getPageByHandle: (handle) ->
@pages.filter((p) -> !p.closed && p.handle == handle)[0]
runCommand: (command) ->
@current_command = command
@@ -66,10 +68,11 @@
if @_debug
console.log "poltergeist [#{new Date().getTime()}] #{message}"
setModalMessage: (msg) ->
@processed_modal_messages.push(msg)
+ return
add_extension: (extension) ->
@currentPage.injectExtension extension
@current_command.sendResponse 'success'
@@ -104,10 +107,11 @@
@currentPage.waitState 'default', =>
if @currentPage.statusCode == null && @currentPage.status == 'fail'
command.sendError(new Poltergeist.StatusFailError(url))
else
command.sendResponse(status: @currentPage.status)
+ return
current_url: ->
@current_command.sendResponse @currentPage.currentUrl()
status_code: ->
@@ -266,10 +270,9 @@
@current_command.sendResponse(false)
mouse_event: (page_id, id, name) ->
# Get the node before changing state, in case there is an exception
node = this.node(page_id, id)
-
# If the event triggers onNavigationRequested, we will transition to the 'loading'
# state and wait for onLoadFinished before sending a response.
@currentPage.state = 'mouse_event'
@last_mouse_event = node.mouseEvent(name)