From 731bd225ce5de302439cf9a10ccb82d8577d88c3 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sat, 8 Jan 2022 23:24:43 +0900 Subject: [PATCH] Update chrome.js --- lib/chrome.js | 7 +++++++ 1 file changed, 7 insertions(+) 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);