export default class Storage {
    
}
@@ -1,8 +1,29 @@
+import fs from 'fs'%0A%0A
 export d
@@ -47,12 +47,2203 @@
 age %7B%0A  
-  
+static async addHistoryItem (title, url) %7B%0A    return new Promise((resolve, reject) =%3E %7B%0A      if (title != null && url != null) %7B%0A        // Get today's date.%0A        let today = new Date()%0A        let dd = today.getDate()%0A        let mm = today.getMonth() + 1%0A        let yyyy = today.getFullYear()%0A  %0A        if (dd %3C 10) %7B%0A          dd = '0' + dd%0A        %7D%0A  %0A        if (mm %3C 10) %7B%0A          mm = '0' + mm%0A        %7D%0A  %0A        today = mm + '-' + dd + '-' + yyyy%0A  %0A        let data = Storage.getHistory()%0A  %0A        if (!url.startsWith('wexond://') && !url.startsWith('about:blank')) %7B%0A          // Get current time.%0A          let date = new Date()%0A          let currentHour = date.getHours()%0A          let currentMinute = date.getMinutes()%0A          let time = %60$%7BcurrentHour%7D:$%7BcurrentMinute%7D%60%0A  %0A          // Configure newItem's data.%0A          let newItem = %7B%0A            'url': url,%0A            'title': title,%0A            'date': today,%0A            'time': time%0A          %7D%0A  %0A          // Get newItem's new id.%0A          if (data%5Bdata.length - 1%5D == null) %7B%0A            newItem.id = 0%0A          %7D else %7B%0A            newItem.id = data%5Bdata.length - 1%5D.id + 1%0A          %7D%0A  %0A          // Push new history item.%0A          data.push(newItem)%0A  %0A          try %7B%0A            await Storage.saveHistory(data)%0A            resolve()%0A          %7D catch (error) %7B%0A            reject(error)%0A          %7D%0A        %7D%0A      %7D%0A    %7D) %0A  %7D%0A%0A  static async saveHistory (jsonObject) %7B%0A    return new Promise((resolve, reject) =%3E %7B%0A      fs.writeFile(global.historyPath, JSON.stringify(jsonObject), function (error) %7B%0A        if (error) %7B%0A          reject(error)%0A        %7D else %7B%0A          resolve()%0A        %7D%0A      %7D)%0A    %7D)%0A  %7D%0A%0A  static async resetHistory () %7B%0A    return new Promise((resolve, reject) =%3E %7B%0A      try %7B%0A        await Storage.saveHistory(%5B%5D)%0A        resolve()%0A      %7D catch (error) %7B%0A        reject(error)%0A      %7D%0A    %7D)%0A  %7D%0A%0A  static getHistory () %7B%0A    return new Promise((resolve, reject) =%3E %7B%0A      fs.readFile(global.historyPath, function (error, data) %7B%0A        if (error) %7B%0A          reject(error)%0A        %7D else %7B%0A          resolve(JSON.parse(data))%0A        %7D%0A      %7D)%0A    %7D)%0A  %7D
 %0A%7D

Add saving & reading history functions