Skip to content

Instantly share code, notes, and snippets.

@ericallam
Created March 8, 2012 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericallam/2002953 to your computer and use it in GitHub Desktop.
Save ericallam/2002953 to your computer and use it in GitHub Desktop.
phantomjs security exception when using evaluate without first using open
page = new WebPage()
page.viewportSize = { width: 800, height: 800 }
page.content = "<html><head><title></title></head><body><div></div></body></html>"
page.onConsoleMessage = (msg) ->
console.log msg
page.evaluate ->
console.log window.location.protocol # about:
window.history.pushState({}, "1", "demo-1.html") # results in an Error: SECURITY_ERR: DOM Exception 18
phantom.exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment