From 1f7bbe48d96b1ac61004aba31dbd099ce070cbb3 Mon Sep 17 00:00:00 2001 From: hackademix Date: Tue, 8 Aug 2023 23:28:42 +0200 Subject: [PATCH] [nscl] Replaced lib/sha256.js with web platform native implementation (thanks Martin for suggested patch). --- src/content/content.js | 6 +++--- src/manifest.json | 4 ++-- src/nscl | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/content/content.js b/src/content/content.js index 208d534..c207aac 100644 --- a/src/content/content.js +++ b/src/content/content.js @@ -89,10 +89,10 @@ Messages.addHandler({ debug("COLLECT", list); return list; }, - store(event) { + async store(event) { if (document.URL !== event.url) return; - let {data} = event; - let attr = sha256(data.concat(Math.random())); + const {data} = event; + const attr = await sha256(data.concat(Math.random())); document.documentElement.dataset[attr] = data; return attr; }, diff --git a/src/manifest.json b/src/manifest.json index 2e19c08..ae91445 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -37,7 +37,7 @@ "scripts": [ "/nscl/lib/browser-polyfill.js", "/nscl/lib/punycode.js", - "/nscl/lib/sha256.js", + "/nscl/common/sha256.js", "/nscl/common/UA.js", "/nscl/common/uuid.js", "/nscl/common/SyncMessage.js", @@ -89,7 +89,7 @@ "all_frames": true, "js": [ "/nscl/lib/browser-polyfill.js", - "/nscl/lib/sha256.js", + "/nscl/common/sha256.js", "/nscl/common/UA.js", "/nscl/common/uuid.js", "/nscl/common/log.js", diff --git a/src/nscl b/src/nscl index d85cc60..438bc9e 160000 --- a/src/nscl +++ b/src/nscl @@ -1 +1 @@ -Subproject commit d85cc60cf297ad0012260975f3c1633279ddd012 +Subproject commit 438bc9e3d2626521f8d669c32ddb0061fadcc4e5