Scroll To Video Top

0px on top

当前为 2021-12-23 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Scroll To Video Top
  3. // @namespace https://space.bilibili.com/6727237
  4. // @version 1.6
  5. // @description:zh-cn 0px on top
  6. // @author 尺子上的彩虹
  7. // @match https://www.bilibili.com/video/*
  8. // @match https://www.bilibili.com/bangumi/play/*
  9. // @grant none
  10. // @description 0px on top
  11. // ==/UserScript==
  12.  
  13. var windyfunction=function() {
  14. if (document.location.href.match('bangumi')){
  15. document.getElementById("app").style.marginTop="20px";
  16. window.scrollTo(0,76);
  17. } else if (document.location.href.match('video')) {
  18. window.scrollTo(0,95);
  19. } else if (document.location.href.match('play')) {
  20. window.scrollTo(0,76);
  21. }};
  22. setInterval(
  23. function (){
  24. if (document.location.href.match('bangumi')){
  25. document.getElementsByClassName('squirtle-widescreen-wrap squirtle-block-wrap')[0].addEventListener('click',windyfunction);
  26. document.getElementsByClassName('bpx-player-video-inputbar')[0].style.minWidth="100%";
  27. document.getElementsByClassName('bpx-player-video-inputbar')[0].style.width="100%";
  28. document.getElementsByClassName('squirtle-sendbar-wrap squirtle-block-wrap')[0].style.minWidth="900px";
  29. } else if (document.location.href.match('video')) {
  30. document.getElementsByClassName('bilibili-player-video-inputbar')[0].style.maxWidth="100%";
  31. document.getElementsByClassName('bilibili-player-video-inputbar')[0].style.width="100%";
  32. document.getElementsByClassName('bilibili-player-video-btn bilibili-player-video-btn-widescreen')[0].addEventListener('click',windyfunction);
  33. }
  34. },
  35. 500);