diff --git a/lib/chrome.js b/lib/chrome.js index 61a1f68..cef740c 100644 --- a/lib/chrome.js +++ b/lib/chrome.js @@ -465,6 +465,10 @@ var ChromeObject = function() { return page.url; }; + this.triggerEvent = function(eventName, selector) { + return this.evaluate('document.querySelector("' + selector + '").dispatchEvent(new Event("' + eventName + '"))'); + }; + this.create(); };