The regex for injecting the vitals script was targeting all <head> references meaning js comments (see image for godaddy in linked issue) which contained "
" were also being replaced / injected into. Removing the g global flag fixes this.
Have also inlined the core web vitals script to reduce perf overhead of fetching from unpkg which should give more accurate measurements (+/- the observer effect being inevitable - https://en.wikipedia.org/wiki/Observer_effect_(physics))
Issue
Fixes #4.
Details
The regex for injecting the vitals script was targeting all
" were also being replaced / injected into. Removing the<head>
references meaning js comments (see image for godaddy in linked issue) which contained "g
global flag fixes this.Have also inlined the core web vitals script to reduce perf overhead of fetching from unpkg which should give more accurate measurements (+/- the observer effect being inevitable - https://en.wikipedia.org/wiki/Observer_effect_(physics))
CheckList