// ==UserScript== // @name Beautify // @namespace https://github.com/symant233 // @version 0.0.27 // @description 美化<误>各网页界面 // @author symant233 // @icon https://cdn.jsdelivr.net/gh/symant233/PublicTools/Beautify/Bkela.png // @require https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js // @match https://cn.vuejs.org/v2/* // @match https://www.runoob.com/* // @match https://www.zxzj.me/* // @match https://blog.csdn.net/* // @match https://es6.ruanyifeng.com/* // @match https://wenku.baidu.com/* // @match https://didi.github.io/cube-ui/* // @match https://www.bilibili.com/* // @match https://cn.bing.com/search?q=* // @match https://duckduckgo.com/?q=* // @match https://baike.baidu.com/* // @match https://yz.chsi.com.cn/sytj/tj/* // @match https://www.30secondsofcode.org/* // @match https://developer.mozilla.org/* // @match https://juejin.cn/editor/drafts/* // @match https://xui.ptlogin2.qq.com/cgi-bin/xlogin* // @match https://steamcommunity.com/* // @match https://www.pixiv.net/* // @match https://live.bilibili.com/* // @match https://frontendwingman.com/* // @match https://cloud.tencent.com/developer/* // @match https://www.npmjs.com/* // @match https://www.zhihu.com/* // @match https://fanyi.baidu.com/* // @match https://jiexi.8old.cn/* // @match https://read.qidian.com/* // @match https://*.taobao.com/* // @match https://*.tmall.com/* // @match https://caddyserver.com/docs/* // @match https://leetcode-cn.com/* // @grant GM_addStyle // @license GPL-3.0 // @homepageURL https://github.com/symant233/PublicTools // @supportURL https://github.com/symant233/PublicTools/issues // @downloadURL none // ==/UserScript== ;(function() { 'use strict'; if (!$) { var $ = window.jQuery; } GM_addStyle(`body{overflow-y: overlay;} ::-webkit-scrollbar { height: 12px; width: 12px; background-color: initial; }::-webkit-scrollbar-button {height: 0;} ::-webkit-scrollbar-thumb { background-color: rgb(127 127 127 / 40%); background-clip: padding-box; border: solid transparent; border-width: 1px 1px 1px 1px; box-shadow: inset 1px 1px 0 rgb(0 0 0 / 10%), inset 0 -1px 0 rgb(0 0 0 / 7%); }::-webkit-scrollbar-thumb:hover{ background: rgb(127 127 127 / 60%); background-clip: padding-box; }::-webkit-scrollbar-thumb:active{ background: rgb(127 127 127 / 85%); background-clip: padding-box; }::-webkit-scrollbar-track { background-clip: padding-box; border: solid transparent; border-width: 0 0 0 4px; }`); (function(left, right, color) { const arg = [ `%c ${left} %c ${right} `, 'padding:1px;border-radius:3px 0 0 3px;color:#fff;background:#606060;', `padding:1px;border-radius:0 3px 3px 0;color:#fff;background:${color}` ]; console.log(...arg); })('Loaded', 'Beautify', '#e99010'); switch (document.domain){ case 'cn.vuejs.org': //缩小导航栏 $('body').css("padding-top", "43px"); $('#header').css({"padding": "0px", "height": "43px", "box-shadow": "0px 0px 5px 0px rgba(0,0,0,0.2)"}); $('#logo').css("padding-left", "10px"); $('#nav').css("top", "1px"); $('.sidebar').css("top", "43px"); $('.sidebar-inner').css("padding-top", "13px"); break; case 'www.runoob.com': //隐藏头部logo 移动搜索框位置到navbar $('#index-nav').append(`
`); $('.pc-nav').append(``); $('.logo-search').remove(); $('.col.nav').css("padding-top", "5px"); $('#sidebar-right-re').parent().remove(); //右侧广告 $('.feedback-btn').remove(); //反馈按钮 $('.qrcode').remove; //右侧悬浮二维码 $('.navigation').css("background", "grey"); if (document.location.href.split('/')[3] == "try") { $('nav').remove(); $("body").css("padding-top", "60px"); $('footer').remove(); } break; case 'www.zxzj.me': //缩小间距 省得用滚轮 $('.stui-header').css("margin", "0px"); $('.stui-page__item').css("margin", "0px"); $('.stui-screen').css("padding", "0px"); //$('.stui-vodlist li').css("padding", "0px 10px"); $('.stui-pannel').css("margin-bottom", "0px"); //$('.head.clearfix').css("padding", "5px"); break; case 'csdn.net': { console.log('Beautify@ try to click'); var r = $('.btn-readmore')[0].click(); console.log('Beautify@ clicked:' + r); break; } case 'es6.ruanyifeng.com': $('#content').css("width", "63%"); $('#content').css("padding-bottom", "0px"); $('#back_to_top').css("right", "35px"); $('#edit').css("right", "35px"); $('#theme').css("right", "35px"); $('#flip').css("right", "10px"); break; case 'wenku.baidu.com': setTimeout(function() { console.log('show more'); $('.btn-know').click(); $('.moreBtn').click(); }, 1500 ); break; case 'didi.github.io': setTimeout(function() { document.getElementsByClassName('navigator')[0].style.height = "54px"; document.getElementsByClassName('navigator')[0].style.lineHeight = "54px"; document.getElementsByClassName('home-view')[0].style.paddingTop = "38px"; }, 500 ); break; case 'www.bilibili.com': { // 宽屏模式 来自 https://github.com/bilibili-helper/bilibili-helper-o/blob/637d0741b0d81154c7bc330f8fce19b926f5a71b/src/js/modules/videoWiden/UI/index.js function setWide () { const btn = document.querySelector('.bilibili-player-video-btn-widescreen:not(.closed)'); if (btn && !btn.getAttribute('bilibili-helper-data')) { btn.setAttribute('bilibili-helper-data', true); btn.click(); } } new Promise(resolve => { setWide(); const player = document.querySelector('#bofqi, #bilibiliPlayer'); if (player) { new MutationObserver((mutationList) => { mutationList.forEach((mutation) => { if (mutation.oldValue) { setWide(); } }); }).observe(player, { attributes: true, attributeOldValue: true, subtree: true, }); } resolve(); }); // PiP 画中画模式快捷键`p` document.addEventListener('keyup', function (e) { if (e.key === 'p') { $('.bilibili-player-iconfont-pip-on').click(); } else if (e.key === 'ArrowRight' & e.altKey === true) { $('.bilibili-player-video-btn-next').click(); } }, false); // 美化评论框 GM_addStyle(`.comment-emoji.comment-emoji-lite{ position: absolute !important; bottom: 15px; left: 3px; padding: 5px !important; box-shadow: unset !important; background: white; }.comment-send-lite{background: unset !important;}`); break; } case 'cn.bing.com': { $("head").append(''); break; } case 'duckduckgo.com': { $("head").append(''); break; } case 'baike.baidu.com': $('#sl-player-el-video').remove(); // 删除播放器 $('.sl-player-el-container').remove(); // 删除播放器容器 GM_addStyle(`.lemmaWgt-searchHeader{height:55px;} .content-wrapper .content {font: unset;} .wgt-searchbar-new.wgt-searchbar .logo-container{padding: 6px 0;} .wgt-searchbar-new.wgt-searchbar .search{padding: 8px 0;} .wgt-navbar-hover {margin-top: 5px;}`); break; case 'yz.chsi.com.cn': { // 去除不符合不能调剂的信息 function filter() { const tmp = $("#content-qecxList > table > tbody").children(); for ( let i in tmp ) { if ( tmp[i].lastElementChild.innerText.includes("不符合") || tmp[i].lastElementChild.firstElementChild.title.includes('不符合') ) { tmp[i].remove(); console.log(tmp[i].textContent + 'removed'); } } } $('').appendTo('.ewm-fix'); $('#btn-filter').click(filter); document.addEventListener('keyup', function (e) { if (e.key === 'Enter' && e.ctrlKey) { $('.tj-seach-btn').click(); } }, false); break; } case 'www.30secondsofcode.org': GM_addStyle('.nav-bar{height:auto;}'); break; case 'developer.mozilla.org': { GM_addStyle(` .page-header{padding:12px 24px;} .breadcrumb-locale-container,#license{margin:0px;} .logo{height:59px;} .localized-content-note.notecard.neutral{display:none;} .header-search{margin-bottom: 4px;} a#beautify-turn:after {content:"|";display:inline-block;margin:0 6px;} a#beautify-turn {width: 62px;float: right;}`); let link = document.location.href; link = link.replace('/en-US/', '/zh-CN/'); if (document.querySelector('.language-toggle')) { $(".language-toggle").prepend(`