From aa28a8cf35b8598ff8391019b14b48aed12a60a5 Mon Sep 17 00:00:00 2001 From: ShengHuang Date: Tue, 14 May 2024 03:20:56 +0800 Subject: [PATCH] print values --- js/plugin_juicity/juicity.js | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/js/plugin_juicity/juicity.js b/js/plugin_juicity/juicity.js index 3e0fb5c..e746cd6 100644 --- a/js/plugin_juicity/juicity.js +++ b/js/plugin_juicity/juicity.js @@ -31,9 +31,20 @@ class juicityClass { this.sharedStorage[k] = v; } } + neko.logError( + "_initDefaultSharedStorage: \n" + + "defaultSharedStorage: \n" + + JSON.stringify(this.defaultSharedStorage) + "\n" + + "sharedStorage: \n" + + JSON.stringify(this.sharedStorage) + ) } _onSharedStorageUpdated() { + neko.logError( + "_onSharedStorageUpdated[First]: \n" + + JSON.stringify(this.sharedStorage) + "\n" + ) // not null for (var k in this.sharedStorage) { if (this.sharedStorage[k] == null) { @@ -41,6 +52,10 @@ class juicityClass { } } this._setShareLink(); + neko.logError( + "_onSharedStorageUpdated[end]: \n" + + JSON.stringify(this.sharedStorage) + "\n" + ) } // 生成并存储 share link @@ -63,6 +78,10 @@ class juicityClass { builder.searchParams.set("pinned_certchain_sha256", this.sharedStorage.pinnedCertchainSha256) } this.sharedStorage.shareLink = builder.toString() + neko.logError( + "_setShareLink[end]: \n" + + JSON.stringify(this.sharedStorage) + "\n" + ) } // UI Interface @@ -138,13 +157,27 @@ class juicityClass { setSharedStorage(b64Str) { this.sharedStorage = util.decodeB64Str(b64Str); this._initDefaultSharedStorage(); + neko.logError( + "setSharedStorage[end]: \n" + + JSON.stringify(this.sharedStorage) + "\n" + ) } // 开启设置界面时调用 requireSetProfileCache() { + neko.logError( + "requireSetProfileCache()[first]: \n" + + JSON.stringify(this.sharedStorage) + "\n" + + JSON.stringify(this.common.typeMap) + "\n" + ) for (var k in this.defaultSharedStorage) { this.common.setKV(k, this.sharedStorage[k]); } + neko.logError( + "requireSetProfileCache()[end]: \n" + + JSON.stringify(this.sharedStorage) + "\n" + + JSON.stringify(this.common.typeMap) + "\n" + ) } // 开启设置界面时调用 @@ -160,10 +193,22 @@ class juicityClass { // 保存时调用(混合编辑后的值) sharedStorageFromProfileCache() { + neko.logError( + "sharedStorageFromProfileCache[first]: \n" + + JSON.stringify(this.sharedStorage) + "\n" + ) for (var k in this.defaultSharedStorage) { this.sharedStorage[k] = this.common.getKV(k); } + neko.logError( + "sharedStorageFromProfileCache[center]: \n" + + JSON.stringify(this.sharedStorage) + "\n" + ) this._onSharedStorageUpdated(); + neko.logError( + "sharedStorageFromProfileCache[end]: \n" + + JSON.stringify(this.sharedStorage) + "\n" + ) return JSON.stringify(this.sharedStorage); }