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. --- MANUAL.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'MANUAL.txt') diff --git a/MANUAL.txt b/MANUAL.txt index 59e4b04..48d5561 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -315,6 +315,8 @@ js:: Url which specifies the javascript script document to include in all cgit pages. Default value: "/cgit.js". May be given multiple times, each script URL path is added in the head section of the document in turn. + Each is loaded with defer, so it runs once the page has been parsed, + still in the order given. Setting this to an empty string will disable generation of the link to this file in the head section. -- cgit