From 3761a259f4f129aae70bb30e8dbb255fa09acd6c Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 19 Dec 2023 20:40:15 +0100 Subject: [PATCH] word/quiz: apply subsequent hash parameters Broken (or unfinished) in commit v1.13-53-ged90e77238 (2023-02-09) [decode uri-encoded location hash]. --- word/quiz.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/word/quiz.js b/word/quiz.js index dce5f7a..5498809 100644 --- a/word/quiz.js +++ b/word/quiz.js @@ -7,9 +7,12 @@ Array.prototype.shuffle = function () { }; function hashparams() { - // location.hash is not encoded in firefox - const encodedhash = (window.location.href.split('#'))[1] || ''; - return decodeURIComponent(encodedhash).split('#'); + const encodedhash = window.location.href.split('#').slice(1) || ''; + if (encodedhash.length == 1) { + // location.hash is not encoded in firefox + return decodeURIComponent(encodedhash).split('#'); + } + return encodedhash; } class Words { -- 2.30.0