assaf / zombie

Insanely fast, full-stack, headless browser testing using node.js
http://zombie.js.org/
MIT License
5.65k stars 518 forks source link

Emit on MessageEvent #1198

Closed rosano closed 4 years ago

rosano commented 5 years ago

I changed this for myself but thought maybe it could be useful generally. It allows you to listen for postMessage in the same way as alert or confirm - something like

Browser.extend(function(browser) {
    browser.on('message', function(data) {
        console.log('postMessage fired', data);
    });
});