diff --git a/lib/chrome.js b/lib/chrome.js index 7bfbffd..8eab1b5 100644 --- a/lib/chrome.js +++ b/lib/chrome.js @@ -385,13 +385,19 @@ var ChromeObject = function() { } // get current title - this.title = this.getTitle(); + var _title = this.getTitle(); - // will be change title - title = this.title + " " + this.pageId.substring(0, 6); + // if not focused + if (_title.indexOf(this.pageId.substring(0, 6)) < 0) { + // save previous title + this.title = _title; - // change webpage title for focusing window - this.setTitle(title); + // will be change title + title = this.title + " " + this.pageId.substring(0, 6); + + // change webpage title for focusing window + this.setTitle(title); + } // find window by title var pageList = this.getPageList(); @@ -406,7 +412,6 @@ var ChromeObject = function() { return title; }; - this.blur = function() { return this.setTitle(this.title); };