Sha256: 0c5dec4e475f3e2a1f850b0577ff4ea9aed174a29bef97886bc5b088306a6107
Contents?: true
Size: 543 Bytes
Versions: 17
Compression:
Stored size: 543 Bytes
Contents
p = require("webpage").create() p.onConsoleMessage = (msg) -> console.log msg # Calls to "callPhantom" within the page 'p' arrive here p.onCallback = (msg) -> console.log "Received by the 'phantom' main context: " + msg "Hello there, I'm coming to you from the 'phantom' context instead" p.evaluate -> # Return-value of the "onCallback" handler arrive here callbackResponse = window.callPhantom "Hello, I'm coming to you from the 'page' context" console.log "Received by the 'page' context: " + callbackResponse phantom.exit()
Version data entries
17 entries across 17 versions & 2 rubygems