diff --git a/lib/chrome.js b/lib/chrome.js index 9d4491d..82e412f 100644 --- a/lib/chrome.js +++ b/lib/chrome.js @@ -70,7 +70,18 @@ var ChromeObject = function() { this.clearProfile = function() { var FN = SHELL.getPathOfMyDocuments() + "\\UserData_Chrome_" + this.profileName + "\\" + this.profileName; - return FILE.deleteFolder(FN); + while (FILE.folderExists(FN)) { + try { + return FILE.deleteFolder(FN); + } catch (e) { + console.warn("Can not clear the session! Resaon: " + e.message); + console.warn("Retrying clear the profile..."); + } + } + }; + + this.clear = function() { + return this.clearProfile(); }; this.setUserDataDir = function(dirname) {