diff --git a/lib/chrome.js b/lib/chrome.js index d6db801..334d18a 100644 --- a/lib/chrome.js +++ b/lib/chrome.js @@ -12,6 +12,8 @@ var AutoItX = require("lib/autoitx"); var pageEventId = 0; var ChromeObject = function() { + STD.EventableObject.apply(this, arguments); // set this object to `eventable` + this.workingDirectory = SYS.getEnvString("PROGRAMFILES") + "\\Google\\Chrome\\Application"; this.binPath = SYS.getEnvString("PROGRAMFILES") + "\\Google\\:installedDir\\Application\\chrome.exe"; //this.processID = 0; @@ -472,6 +474,9 @@ var ChromeObject = function() { } } + // calling `onfocus` event + this.dispatchEvent(new STD.Event("focus")); + return title; }; @@ -1048,6 +1053,8 @@ var ChromeObject = function() { this.create(); }; +ChromeObject.prototype = new STD.EventableObject(); +ChromeObject.prototype.constructor = ChromeObject; exports.create = function(profileName) { return (new ChromeObject()).setProfile(profileName, null);