From a9ab0eec660d25ce8fb2a7dae15f6585bcda614f Mon Sep 17 00:00:00 2001 From: 117649 Date: Tue, 14 May 2024 20:14:25 +0800 Subject: [PATCH] fix: matching rule cause ff upgrade backup can't be read --- resource/modules/paneSession.jsm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resource/modules/paneSession.jsm b/resource/modules/paneSession.jsm index 5149945..416b8a6 100644 --- a/resource/modules/paneSession.jsm +++ b/resource/modules/paneSession.jsm @@ -521,7 +521,7 @@ this.paneSession = { } let p = aFile.path || aFile; - window.IOUtils.read(p, p.endsWith("lz4") ? { decompress: true } : null).then(async (savedState) => { + window.IOUtils.readUTF8(p, p.match(".(bak|json)lz4")[0] ? { decompress: true } : null).then(async (savedState) => { this.manualAction = aManualAction; @@ -569,7 +569,7 @@ this.paneSession = { }, getStateForData: function(data) { - return JSON.parse((new TextDecoder()).decode(data)); + return JSON.parse(data); }, readState: function(state) {