Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
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.
Diffstat (limited to '')
-rw-r--r--source/ui-shared.c2
1 file changed, 1 insertion, 1 deletion
diff --git a/source/ui-shared.c b/source/ui-shared.c
index ff691f8..e7b7d88 100644
--- a/source/ui-shared.c
+++ b/source/ui-shared.c
@@ -379,7 +379,7 @@ static void emit_js_link(const char *src)
html("<script src='");
html_attr(src);
- html("'></script>\n");
+ html("' defer></script>\n");
}
static void add_clone_urls(void (*fn)(const char *), char *urls, char *suffix)