From 95640522e4447cf1c33748fee9733b786e2526c2 Mon Sep 17 00:00:00 2001 From: Nadav Ivgi Date: Fri, 1 Sep 2023 18:33:03 +0300 Subject: [PATCH] Disable Elements unblinding in the server-side rendering environment Attempting to access the URL hash fragment (`location.hash`) on the server-side was causing an error, because it is not available there. Unblinding should only be done on the client-side for privacy reasons anyway, so this feature can be disabled entirely on the server-side. --- client/src/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/app.js b/client/src/app.js index 207bfc83..fde58c4e 100644 --- a/client/src/app.js +++ b/client/src/app.js @@ -58,7 +58,7 @@ export default function main({ DOM, HTTP, route, storage, scanner: scan$, search , sort_dir: loc.query.sort_dir != null ? loc.query.sort_dir : 'asc' , limit: +loc.query.limit || 50, })) - , blindingReq$ = !process.env.IS_ELEMENTS ? O.empty() + , blindingReq$ = !(process.env.IS_ELEMENTS && process.browser) ? O.empty() : page$.map(loc => loc.hash.startsWith('#blinded=') ? loc.hash.substr(9) : null) // End Elements only