YouTube Alt+F go to /v/ fullscreen

Make YouTube's player go /v/ fullscreen when pressing Alt+F

  1. // ==UserScript==
  2. // @name YouTube Alt+F go to /v/ fullscreen
  3. // @namespace http://idontknowwhattowritehere.org.net.com
  4. // @version 2014-06-17
  5. // @description Make YouTube's player go /v/ fullscreen when pressing Alt+F
  6. // @include http://www.youtube.com/watch?*
  7. // @include https://www.youtube.com/watch?*
  8. // @copyright ZAO "Roga & Kopyta"
  9. // ==/UserScript==
  10. function EnableFKey()
  11. {
  12. var match = document.location.href.match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/)
  13. document.addEventListener('keypress', function (e) {
  14. if (e.altKey && (e.which == 102 || e.which == 70)) {
  15. //Alt + (f or F) key pressed?
  16. document.location.href = 'https://youtube.com/v/' + match[7]
  17. }
  18. });
  19. }
  20. document.addEventListener('DOMContentLoaded', function () {
  21. EnableFKey()
  22. });
  23. //document.addEventListener('DOMNodeInserted', function() { EnableFKey() }); //Inefficient, but whatever*/

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址