Skip to content

Instantly share code, notes, and snippets.

@mkwiatkowski
Created March 22, 2012 08:40
Show Gist options
  • Save mkwiatkowski/2157174 to your computer and use it in GitHub Desktop.
Save mkwiatkowski/2157174 to your computer and use it in GitHub Desktop.
phantomjs WebPage calls onLoadFinished two times for iframe
page = new WebPage()
page.onConsoleMessage = (msg) ->
console.log(msg)
page.onLoadStarted = ->
console.log('onLoadStarted')
page.onLoadFinished = (status) ->
isFullyLoaded = page.evaluate ->
window is window.top
console.log('onLoadFinished ' + status + ' ' + isFullyLoaded + ' ' + page.evaluate(-> window.location.toString()))
page.open('http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment