Skip to content

Instantly share code, notes, and snippets.

@chidea
Last active April 12, 2020 13:57
Show Gist options
  • Select an option

  • Save chidea/c5324f8d7141185e634353c63bb6c384 to your computer and use it in GitHub Desktop.

Select an option

Save chidea/c5324f8d7141185e634353c63bb6c384 to your computer and use it in GitHub Desktop.

Revisions

  1. chidea revised this gist Apr 12, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions yt_mh_hider.js
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,13 @@
    // ==UserScript==
    // @name Youtube masthead hider
    // @namespace http://tampermonkey.net/
    // @version 0.8
    // @version 0.9
    // @description press h key to hide Youtube masthead menu
    // @author ChIdea
    // @match https://www.youtube.com/*
    // @grant none
    // @updateURL https://gist.github.com/chidea/c5324f8d7141185e634353c63bb6c384/raw/yt_mh_hider.js
    // @downloadURL https://gist.github.com/chidea/c5324f8d7141185e634353c63bb6c384/raw/yt_mh_hider.js
    // @downloadURL https://gist.github.com/chidea/c5324f8d7141185e634353c63bb6c384/raw/yt_mh_hider.js
    // ==/UserScript==

    (function() {
  2. chidea revised this gist Apr 12, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion yt_mh_hider.js
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    // ==UserScript==
    // @name Youtube masthead hider
    // @namespace http://tampermonkey.net/
    // @version 0.7
    // @version 0.8
    // @description press h key to hide Youtube masthead menu
    // @author ChIdea
    // @match https://www.youtube.com/*
  3. chidea revised this gist Apr 12, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion yt_mh_hider.js
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,8 @@
    // @author ChIdea
    // @match https://www.youtube.com/*
    // @grant none
    // @updateURL https://gist.github.com/chidea/c5324f8d7141185e634353c63bb6c384/raw
    // @updateURL https://gist.github.com/chidea/c5324f8d7141185e634353c63bb6c384/raw/yt_mh_hider.js
    // @downloadURL https://gist.github.com/chidea/c5324f8d7141185e634353c63bb6c384/raw/yt_mh_hider.js
    // ==/UserScript==

    (function() {
  4. chidea revised this gist Apr 12, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion yt_mh_hider.js
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@
    // @author ChIdea
    // @match https://www.youtube.com/*
    // @grant none
    // @updateURL https://gist.github.com/chidea/c5324f8d7141185e634353c63bb6c384/raw/yt_mh_hider.js
    // @updateURL https://gist.github.com/chidea/c5324f8d7141185e634353c63bb6c384/raw
    // ==/UserScript==

    (function() {
  5. chidea revised this gist Apr 12, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions yt_mh_hider.js
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    // ==UserScript==
    // @name Youtube masthead hider
    // @namespace http://tampermonkey.net/
    // @version 0.6
    // @version 0.7
    // @description press h key to hide Youtube masthead menu
    // @author ChIdea
    // @match https://www.youtube.com/*
    // @grant none
    // @downloadURL https://gist.github.com/chidea/c5324f8d7141185e634353c63bb6c384/raw/yt_mh_hider.js
    // @updateURL https://gist.github.com/chidea/c5324f8d7141185e634353c63bb6c384/raw/yt_mh_hider.js
    // ==/UserScript==

    (function() {
  6. chidea revised this gist Apr 12, 2020. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions yt_mh_hider.js
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    // ==UserScript==
    // @name Youtube masthead hider
    // @namespace http://tampermonkey.net/
    // @version 0.5
    // @version 0.6
    // @description press h key to hide Youtube masthead menu
    // @author ChIdea
    // @match https://www.youtube.com/watch?*
    // @match https://www.youtube.com/*
    // @grant none
    // @downloadURL https://gist.github.com/chidea/
    // @downloadURL https://gist.github.com/chidea/c5324f8d7141185e634353c63bb6c384/raw/yt_mh_hider.js
    // ==/UserScript==

    (function() {
  7. chidea created this gist Apr 12, 2020.
    32 changes: 32 additions & 0 deletions yt_mh_hider.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    // ==UserScript==
    // @name Youtube masthead hider
    // @namespace http://tampermonkey.net/
    // @version 0.5
    // @description press h key to hide Youtube masthead menu
    // @author ChIdea
    // @match https://www.youtube.com/watch?*
    // @grant none
    // @downloadURL https://gist.github.com/chidea/
    // ==/UserScript==

    (function() {
    'use strict';
    document.onkeypress=function(e){
    if(document.querySelector('ytd-searchbox').hasAttribute('has-focus')) return;
    var k = e.key;
    if (k==='h'){
    if (window.hideheadopt) {
    document.querySelector('#masthead-container').style.display='';
    document.querySelector('#page-manager').style.marginTop='';
    document.querySelector('#primary').style.paddingTop='';
    window.hideheadopt=false;
    }else {
    document.querySelector('#masthead-container').style.display='none';
    document.querySelector('#page-manager').style.marginTop=0;
    document.querySelector('#primary').style.paddingTop=0;
    document.querySelector('#player-theater-container').style.zoom='95%';
    window.hideheadopt=true;
    }
    }
    };
    })();