// ==UserScript== // @name 抖音网页版优化 // @description 抖音网页版推荐页面优化,网页全屏,全黑,自动按浏览器窗口调整大小 // @namespace https://space.bilibili.com/482343 // @author 古海沉舟 // @license 古海沉舟 // @version 1.4.0 // @include https://www.douyin.com/recommend // @include https://www.douyin.com/* // @include https://www.douyin.com/?* // @include https://www.douyin.com/follow // @require https://cdn.staticfile.org/jquery/1.12.4/jquery.min.js // @run-at document-end // @grant GM_setValue // @grant GM_getValue // @grant GM_addValueChangeListener // @noframes // @downloadURL none // ==/UserScript== var lastindex=0; function keydown(event) { //console.log(event.keyCode); if(event.keyCode == 109 || event.keyCode == 189){ // 按-或者小键盘- pagefullscreen(); } } document.addEventListener('keydown', keydown, false); var haspagefullscreen=0; function pagefullscreen(){ //$(`#slidelist > div > div.swiper-wrapper > div.swiper-slide-active xg-icon.xgplayer-page-full-screen > div.xgplayer-icon`).click(); $(`#slidelist > div > div.swiper-wrapper > div.swiper-slide-active xg-icon.xgplayer-page-full-screen > div.xgplayer-icon`).each(function(){ haspagefullscreen=1; $(this).click(); }) } var firstfullscreen=setInterval(function(){ if (haspagefullscreen){ clearInterval(firstfullscreen); return; } pagefullscreen(); },500); function addCSS(){ let wdstyle = document.createElement('style'); wdstyle.classList.add("optimize"); wdstyle.innerHTML = ` div.gNyVUu_s{display:none!important} .qdcce5kG .VFMR0HAe{background:#0000 !important} .vLt8mbfQ .y8iJbHin .mMOxHVzv,.vLt8mbfQ .y8iJbHin .rrKCA47Q{background:#000 !important} .Npz7CPXj{background:#111 !important} ` document.body.appendChild(wdstyle); } addCSS();