🏠 Home 

Player FullScreen Auto

Auto Player full screen for web.


Install this script?
  1. // ==UserScript==
  2. // @name Player FullScreen Auto
  3. // @name:zh-CN 网页自动加载全屏宽屏播放器 - By 全栈CEO
  4. // @namespace https://roceys.cn
  5. // @version 20190929
  6. // @description Auto Player full screen for web.
  7. // @description:zh-CN 虎牙+哔哩哔哩+Youtube直播&视频平台自动全屏宽屏播放器
  8. // @require https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js
  9. // @require https://greasyfork.org/scripts/48306-waitforkeyelements/code/waitForKeyElements.js?version=275769
  10. // @inject-into content
  11. // @run-at document-idle
  12. // @author Roceys
  13. // @license Apache License
  14. // @match *://*.bilibili.com/*
  15. // @match *://www.huya.com/*
  16. // @match *://*.youtube.com/*
  17. // ==/UserScript==
  18. 'use strict'
  19. var selector = {
  20. 'live.bilibili.com': {
  21. 'on': "i[class='live-icon-web-fullscreen']"
  22. },
  23. 'www.bilibili.com':{
  24. 'on':"div[class~='bilibili-player-video-btn-widescreen']"
  25. },
  26. 'www.huya.com': {
  27. 'on': "span[class='player-fullpage-btn']"
  28. },
  29. 'www.youtube.com': {
  30. 'on': "button[class~='ytp-size-button']"
  31. }
  32. }
  33. var domain = document.location.hostname;
  34. function openFullScreen() {
  35. var _click = document.querySelector(selector[domain].on);
  36. if (_click !== null) {
  37. _click.click();
  38. }
  39. }
  40. waitForKeyElements(selector[domain].on, openFullScreen, false);