jQuery .load() changes HTML attributes

jQuery .load() changes HTML attributes

I made a chrome extension that loads videos from the subscription page on youtube into the same page with jQuery using the jQuery .load() function (and then does some checks on it to see if they're new but that's not what I'm here for).

A regular video container's thumbnail's imagetag that isn't loaded with that function looks like this:
  1. <img data-thumb="//i.ytimg.com/vi_webp/BQOXkEU-0T0/mqdefault.webp" src="//i.ytimg.com/vi_webp/BQOXkEU-0T0/mqdefault.webp" alt="" aria-hidden="true" width="196" data-group-key="thumb-group-0">
But when I load it in with the jQuery load function it turns into this:
  1. <img aria-hidden="true" alt="" data-thumb="//i.ytimg.com/vi_webp/BQOXkEU-0T0/mqdefault.webp" src="https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" width="196">

So it basically mixes up the attributes, completely changes the src including the // which it turns into a https:// and it turns it into a gif which is the main problem. The src turning into a gif makes the the thumbnail unreachable because it doesn't exist.

I've just ignored this for a few months because I've just made a work-around but I'm getting curious.