tapio / live-server

A simple development http server with live reload capability.
http://tapiov.net/live-server/
4.41k stars 484 forks source link

Fix css refresh on elements added to <body> #372

Open AlexisPuga opened 3 years ago

AlexisPuga commented 3 years ago

Hi!

Is this project still maintained? I made this modification because I need it for a project, but if you can merge it, it would be great.

Basically, adding a tag outside the element (in the , for example) causes the following error in the console: "Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node."

This commit fixes that (at least in Firefox) by using the parentNode of the element to remove it.

It also adds tests for CSS refreshing, but not as I would like...

PS: Some tests didn't pass in my machine (the --quiet and --port ones). I don't know why, but it has to do nothing with these modifications.

Anyway... I hope you're doing well, and thank you for your time!