paulirish / lite-youtube-embed

A faster youtube embed.
https://paulirish.github.io/lite-youtube-embed/
Other
5.92k stars 274 forks source link

PageSpeed penalizes <lite-youtube> for removing href from <a> #189

Closed arturhonores closed 1 day ago

arturhonores commented 3 weeks ago

When using inside , as shown in the following example:

<lite-youtube videoid="goiWrNiaT0I" style="background-image: url('https://i.ytimg.com/vi/goiWrNiaT0I/hqdefault.jpg');"> <a href="https://youtube.com/watch?v=goiWrNiaT0I" class="lty-playbtn" title="Play Video"> <span class="lyt-visually-hidden">Play Video: Crayon Physics Deluxe - Trailer HD</span> </a> </lite-youtube>

PageSpeed penalizes the component with the message: "Links are not traceable". I found a temporary solution by adding role="button", but I’d like to know if it’s necessary to keep using the tag since the code removes the href in this line:

playBtnEl.removeAttribute('href');

paulirish commented 1 day ago

That was fixed in #183

Latest release v0.3.3 will sort you out.