From ead315251f23579301adefbae16cc34594b5f0f1 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Mon, 6 Oct 2025 17:38:09 +0200 Subject: [PATCH] suppress noise from early initialization during unit tests the tests still all passed, but the missing browser globals in the node environment could cause misleading messages in the mocha output --- js/legacy.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/legacy.js b/js/legacy.js index 1f27107b..38f3cb2d 100644 --- a/js/legacy.js +++ b/js/legacy.js @@ -246,6 +246,11 @@ */ me.init = function() { + // prevent early init + if (typeof document === 'undefined' || typeof navigator === 'undefined' || typeof window === 'undefined') { + return; + } + // prevent bots from viewing a document and potentially deleting data // when burn-after-reading is set if (isBadBot()) {