hiddentao / gulp-server-livereload

Gulp plugin to run a local webserver with livereload enabled via socket.io. Also comes with standalone command-line interface.
MIT License
93 stars 28 forks source link

Script injected with page that don't have <body> or <html> will run in error. #51

Closed arzyu closed 3 years ago

arzyu commented 7 years ago

This is my page index.html:

<!DOCTYPE html>
<meta charset="UTF-8">
<title>test</title>
<p>This is a valid html document.</p>

Livereload script will run into an error at document.body.appendChild(_lrscript); when injecting into this page. In this case, document.body is null.

See my demo: livereload-test.zip