From c5ad21873acdbf3cba69d43ef9b7a5376ff3f048 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Thu, 29 Oct 2026 13:31:06 -1000 Subject: Load the scripts with defer A plain script in the head held up parsing until it had downloaded and run, though cgit.js only acts once the document is ready. Deferred scripts still run in the order given and before DOMContentLoaded, so a site script after cgit.js can still call window.cgit. --- tests/t0005-markup.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/t0005-markup.sh') diff --git a/tests/t0005-markup.sh b/tests/t0005-markup.sh index e2bf8f3..22ac81c 100755 --- a/tests/t0005-markup.sh +++ b/tests/t0005-markup.sh @@ -120,6 +120,11 @@ test_expect_success 'the page background is the same everywhere it is set' ' test_cmp expect actual ' +test_expect_success 'the script waits for the page instead of holding it up' ' + hooks "hooks/" >tmp && + grep "" tmp +' + # The rest of the hooks need a tag, a symlink, a submodule, a trailer, a lone # carriage return, clone urls, an empty repository and a second page of # repositories, so they get a commit and a config of their own after the checks -- cgit