From a5e50771b3e6b1cefa9555f411d9ac5917b27759 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Tue, 11 Jan 2022 21:32:18 +0900 Subject: [PATCH] Update chrome.js --- lib/chrome.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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) {