0

I couldn't manage to find anything on how to use Jquery to append &html5=1 to the video results on search/feed/subscriptions and such to all video URL's.

The following are links that MAY contribute to a solution:

Example 1: http://jsfiddle.net/WFd79/

Example 2: YouTube video in HTML not working

Example 3:

function main(){    
    //Standard Logo
    document.getElementById('.yt-lockup.yt-lockup-tile a.ux-thumb-wrap').setAttribute('href', 'http://www.youtube.com/feed/subscriptions');
}
main();

Note: If commas can be used to append to multiple ID's or classes such as titles plus thumbnails, would be more user friendly. This is also not needing a solution for embeds or iframes.

Note 2: I use tampermonkey extension to inject jquery.

P.S. I thank anyone who attemps to find a solution or has one so others may benefit from this as well.

Community
  • 1
  • 1
computerguy
  • 177
  • 9

1 Answers1

1

I am not sure if this is the most elegant way, but it seems to be working:

$(".yt-lockup A.yt-uix-sessionlink").attr("href", function(i, href) {
  return href + '&html5=1';
});

From:

  1. https://stackoverflow.com/a/2805905/2038928

  2. http://community.sitepoint.com/t/jquery-append-query-string-to-href/6003
  3. Append Query String to URL with Jquery
  4. https://stackoverflow.com/a/6934732/2038928
Community
  • 1
  • 1
computerguy
  • 177
  • 9