Browser extension to watch YouTube videos without the distracting cruft around it, in the full window.
Browse Source

Hide video annotations and YouTube branding

tags/v1.3.0
Gerben 6 years ago
parent
commit
80564ea6ca
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      extension/background.js

+ 6
- 1
extension/background.js View File

@@ -41,9 +41,12 @@ function cruftedToEmbeddableVideoUrl(url) {
url = new URL(url); url = new URL(url);
var videoId = url.searchParams.get('v'); var videoId = url.searchParams.get('v');
url.pathname = '/embed/' + videoId; url.pathname = '/embed/' + videoId;
// API docs: https://developers.google.com/youtube/player_parameters
url.searchParams.delete('v'); url.searchParams.delete('v');
url.searchParams.set('rel', '0'); // no suggestions after my video, please. url.searchParams.set('rel', '0'); // no suggestions after my video, please.
url.searchParams.set('autoplay', '1');
url.searchParams.set('iv_load_policy', '3'); // no video annotations, thanks.
url.searchParams.set('modestbranding', '1'); // no YouTube branding either.
url.searchParams.set('autoplay', '1'); // do play my video! :)
return url.href; return url.href;
} }


@@ -53,6 +56,8 @@ function embeddableToCruftedVideoUrl(url) {
url.pathname = '/watch'; url.pathname = '/watch';
url.searchParams.set('v', videoId); url.searchParams.set('v', videoId);
url.searchParams.delete('rel'); url.searchParams.delete('rel');
url.searchParams.delete('modestbranding');
url.searchParams.delete('iv_load_policy');
url.searchParams.delete('autoplay'); url.searchParams.delete('autoplay');
return url.href; return url.href;
} }


Loading…
Cancel
Save