In #6821 we moved the loading from end of body to head to make Turbolinks and similar work.
This commit adds a defer attribute to avoid page parse blocking.
return err
}
- script := []byte(fmt.Sprintf(`<script src="/livereload.js?port=%d&mindelay=10&v=2" data-no-instant></script>`, port))
+ script := []byte(fmt.Sprintf(`<script src="/livereload.js?port=%d&mindelay=10&v=2" data-no-instant defer></script>`, port))
i := idx
if match.appendScript {
func TestLiveReloadInject(t *testing.T) {
c := qt.New(t)
- expectBase := `<script src="/livereload.js?port=1313&mindelay=10&v=2" data-no-instant></script>`
+ expectBase := `<script src="/livereload.js?port=1313&mindelay=10&v=2" data-no-instant defer></script>`
apply := func(s string) string {
out := new(bytes.Buffer)
in := strings.NewReader(s)