From f7f2fe1e876dbe14e17e796cdb89a2abea569963 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Mon, 26 Oct 2026 21:26:33 -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') 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 2.12.1