Greasy Fork is available in English.
删除元素,logo,达到极简效果
当前为
// ==UserScript==
// @name 爱奇艺,优酷,腾讯视频 简洁画面,logo水印移除
// @namespace http://tampermonkey.net/
// @version 1.410
// @description 删除元素,logo,达到极简效果
// @author Xian
// @match https://www.iqiyi.com/*.html*
// @match https://v.qq.com/x/*.html*
// @match https://v.youku.com/v_show/*.html*
// https://y.qq.com/n/yqq/mv/v/*.html
// @grant none
// ==/UserScript==
(function() {
'use strict';
//鼠标悬停
var a;
document.getElementsByTagName('body')[0].onmousemove = function() {
document.getElementsByTagName('body')[0].style.cursor = 'auto';
clearTimeout(a);
a = setTimeout(function() {
document.getElementsByTagName('body')[0].style.cursor = 'none';
}, 2000);
};
var aqy_a = document.createElement("div");
var txsp_a=document.createElement("div");
styleys();
aqy_a.style.zIndex = '999';
txsp_a.style.zIndex = '998';
aqy_a.style.width = '110px';
aqy_a.style.height = '48px'; //21
txsp_a.style.userSelect =aqy_a.style.userSelect = 'none';
txsp_a.style.position = 'fixed';
txsp_a.style.opacity=aqy_a.style.left =txsp_a.style.left = '0';
aqy_a.style.transition =txsp_a.style.transition = 'all .5s ease';
txsp_a.style.overflow =aqy_a.style.overflow = 'hidden';
aqy_a.style.position = 'fixed';
txsp_a.style.top =aqy_a.style.top = '10%';
txsp_a.style.padding =aqy_a.style.padding = '10px';
txsp_a.style.width='200px';
aqy_a.innerHTML +=
"配置元素<button type='button' style='border: 1px solid black;padding:2px 5px;margin-left: 5px;margin-bottom: 2px;border-radius: 5px;color:#d1d1d1;background-color:gray;' id='qwer'>展开</button><br>";
aqy_a.innerHTML +=
"<a id='callth' title='关闭后按ctrl+shift+Q即可恢复' onclick='this.parentNode.remove()' style='position: absolute;right: 3px;top: 13px;border: 1px solid black;display: inline-block;border-radius: 50%;width: 15px;height: 15px;line-height: 14px;text-align: center;font-size:17px;'>×</a>";
aqy_a.innerHTML +=
"<button type='button' style='border: 1px solid black;padding:2px 5px;margin:0 0px 5px 5px;border-radius: 5px;color:#d1d1d1;background-color:gray;' id='wyfull'>开启网页全屏</button><br/>"
aqy_a.innerHTML +=
"全选<input type='checkbox' id='checkall'style='-webkit-appearance:auto;transform: translate(7px,3px);display: inline-block;' /><button type='button' id='zdyhp' style='border: 1px solid black;padding:2px 5px;margin-left: 5px;margin-bottom: 2px;border-radius: 5px;color:#d1d1d1;background-color:gray;float:right;width:20px;'>自定义样式</button><br/>";
aqy_a.innerHTML +=
"是否删除花絮和推荐<br/><input type='radio' style='-webkit-appearance:auto;display: inline-block;margin-left:5px;opacity: 1;' id='check01t' name='check01'/><label for='check01t'>是</label><input type='radio' style='-webkit-appearance:auto;display: inline-block;margin-left:10px;opacity: 1;' id='check01f' name='check01'/><label for='check01f'>否</label><br>";
aqy_a.innerHTML +=
"是否删除暂停时广告<br/><input type='radio' style='-webkit-appearance:auto;display: inline-block;margin-left:5px;opacity: 1;' id='check02t' name='check02'/><label for='check02t'>是</label><input type='radio' style='-webkit-appearance:auto;display: inline-block;margin-left:10px;opacity: 1;' id='check02f' name='check02'/><label for='check02f'>否</label><br>";
aqy_a.innerHTML +=
"是否删除视频上水印<br/><input type='radio' style='-webkit-appearance:auto;display: inline-block;margin-left:5px;opacity: 1;' id='check03t' name='check03'/><label for='check03t'>是</label><input type='radio' style='-webkit-appearance:auto;display: inline-block;margin-left:10px;opacity: 1;' id='check03f' name='check03'/><label for='check03f'>否</label><br>";
aqy_a.innerHTML +=
"是否删除头部标题栏<br/><input type='radio' style='-webkit-appearance:auto;display: inline-block;margin-left:5px;opacity: 1;' id='check04t' name='check04'/><label for='check04t'>是</label><input type='radio' style='-webkit-appearance:auto;display: inline-block;margin-left:10px;opacity: 1;' id='check04f' name='check04'/><label for='check04f'>否</label><br>";
aqy_a.innerHTML +=
"是否删除下滑更多内容<br/><input type='radio' style='-webkit-appearance:auto;display: inline-block;margin-left:5px;opacity: 1;' id='check05t' name='check05'/><label for='check05t'>是</label><input type='radio' style='-webkit-appearance:auto;display: inline-block;margin-left:10px;opacity: 1;' id='check05f' name='check05'/><label for='check05f'>否</label><br>";
aqy_a.innerHTML +=
"是否强制移除弹幕<br/><input type='radio' style='-webkit-appearance:auto;display: inline-block;margin-left:5px;opacity: 1;' id='check06t' name='check06'/><label for='check06t'>是</label><input type='radio' style='-webkit-appearance:auto;display: inline-block;margin-left:10px;opacity: 1;' id='check06f' name='check06'/><label for='check06f'>否</label><br>";
aqy_a.innerHTML +=
"是否自动隐藏此面板<br/><input type='radio' style='-webkit-appearance:auto;display: inline-block;margin-left:5px;opacity: 1;' id='check07t' name='check07'/><label for='check07t'>是</label><input type='radio' style='-webkit-appearance:auto;display: inline-block;margin-left:10px;opacity: 1;' id='check07f' name='check07'/><label for='check07f'>否</label><br>";
aqy_a.innerHTML +=
"取消删除后页面刷新才会生效!<br/><button id='saveChange' style='border: 1px solid black;margin:0 5px;padding:2px;width:40px;border-radius: 5px;color:#d1d1d1;background-color:gray;'>保存</button><button id='sxym' style='border: 1px solid black;margin:0 5px;padding:2px;border-radius: 5px;color:#d1d1d1;background-color:gray;'>刷新页面</button><button id='clearChange' style='border: 1px solid black;margin:0 5px;padding:2px;width:40px;border-radius: 5px;color:#d1d1d1;background-color:gray;'>重置</button>";
txsp_a.innerHTML+='边框圆角大小(建议0~30):<input id="borderR" type="number" placeholder="不宜过高,建议在0~30" value="'+localStorage.getItem("borderRadius")+'" min="0" style="width:75%;"/>px</br>';
txsp_a.innerHTML+='透明度(10~100):<input id="tmd" type="number" placeholder="10~100" value="'+localStorage.getItem("optmd")+'" min="0" max="100" style="width:75%;"/></br>';
//txsp_a.innerHTML+='字体大小:<input id="textSize" type="number" placeholder="123" value="'+localStorage.getItem("textSize")+'" min="0" max="100" style="width:75%;"/></br>';
txsp_a.innerHTML+='颜色<a style="float:right;color:blue;text-decoration: underline;"target="view_window" href="https://www.917118.com/tool/color.html">颜色索引地址</a></br>可输入颜色英文 rgb代码(#ffffff)</br>背景:<input id="backgroundC" type="text" placeholder="#ffffff" value="'+localStorage.getItem("backColor")+'" style="width:75%;"/></br>';
txsp_a.innerHTML+='文字:<input id="textColor" type="text" placeholder="#000000" value="'+localStorage.getItem("textColor")+'" style="width:75%;"/></br>';
txsp_a.innerHTML+="<button id='saveChangeys' style='border: 1px solid black;margin:0 5px;padding:2px;width:40px;border-radius: 5px;color:#d1d1d1;background-color:gray;'>保存</button>";
document.body.appendChild(txsp_a);
document.body.appendChild(aqy_a);
document.getElementById('zdyhp').onclick=function(){
if(txsp_a.style.opacity=='0'){
txsp_a.style.opacity='1';
txsp_a.style.left = '205px';
}else{
txsp_a.style.opacity='0';
txsp_a.style.left = '0';
}
}
document.getElementById('saveChangeys').onclick=function(){
//localStorage.setItem('textSize', document.getElementById('textSize').value);
localStorage.setItem('textColor', document.getElementById('textColor').value);
localStorage.setItem('backColor', document.getElementById('backgroundC').value);
localStorage.setItem('borderRadius', document.getElementById('borderR').value);
if(document.getElementById('tmd').value<10&&document.getElementById('tmd').value == null){
document.getElementById('tmd').style.border='red 3px solid';
document.getElementById('tmd').placeholder='透明度不能低于10!!';
document.getElementById('tmd').value='';
}else{
localStorage.setItem('optmd', document.getElementById('tmd').value);
}
styleys();
}
function styleys(){
if(localStorage.getItem("optmd")==null){
var aaa=1;
}else{
aaa=localStorage.getItem("optmd")/100
}if(localStorage.getItem("backColor")==null){
var bbb='white';
}else{
bbb=localStorage.getItem("backColor")
}if(localStorage.getItem("textColor")==null){
var ccc='black';
}else{
ccc=localStorage.getItem("textColor");
}
txsp_a.style.borderRadius =aqy_a.style.borderRadius = localStorage.getItem("borderRadius")+'px';
txsp_a.style.backgroundColor=aqy_a.style.backgroundColor = bbb;
aqy_a.style.opacity=aaa;
txsp_a.style.color = aqy_a.style.color = ccc;
txsp_a.style.fontSize =aqy_a.style.fontSize = '13px';
//txsp_a.style.fontSize =aqy_a.style.fontSize = localStorage.getItem("textSize")+'px';
}
//按键恢复控制面板
document.onkeydown = function(e) {
if (window.event){
e = window.event;
}
var code = e.charCode || e.keyCode;
if (e.ctrlKey && e.shiftKey && code == 81) {
try {
document.getElementById('callth').click();
} catch (e) {
document.body.appendChild(aqy_a);
}
}
}
// document.getElementsByClassName('unfold-icon')[0].parentNode.click();
//广告
setInterval(function() {
try {
document.getElementById('block-V').remove();
} catch (e) {}
try {
document.getElementsByClassName('side_ad')[0].remove();
document.getElementsByClassName('side_ad')[1].remove();
} catch (e) {}
try {
document.getElementById('right-title-ad-banner').remove();
} catch (e) {}
try {
document.getElementById('_vip_player_sec').remove();
} catch (e) {}
try {
document.getElementsByClassName('detail-sd')[0].remove();
} catch (e) {}
try {
document.getElementsByClassName('mod_ad')[0].remove();
} catch (e) {}
try {
document.getElementsByClassName('qr-wrap')[0].remove();
} catch (e) {}
}, 2000);
//展开按钮
document.getElementById('qwer').onclick = function() {
if (this.parentNode.style.width =='110px') {
this.parentNode.style.width = '183px';
this.parentNode.style.height = '395px';
document.getElementById('qwer').innerText = '收起';
} else {
this.parentNode.style.width = '110px';
this.parentNode.style.height = '48px';
if(txsp_a.style.opacity=='1'){
txsp_a.style.left =txsp_a.style.opacity='0';
}
document.getElementById('qwer').innerText = '展开';
}
}
//网页全屏
document.getElementById('wyfull').onclick = function() {
if (this.innerHTML == '开启网页全屏') {
var de = document.documentElement;
if (de.requestFullscreen) {
de.requestFullscreen();
}
if (de.mozRequestFullScreen) {
de.mozRequestFullScreen();
}
if (de.webkitRequestFullScreen) {
de.webkitRequestFullScreen();
}
this.innerText = '关闭网页全屏'
} else {
var dwe = document;
if (dwe.exitFullscreen) {
dwe.exitFullscreen();
} else if (dwe.mozCancelFullScreen) {
dwe.mozCancelFullScreen();
} else if (dwe.webkitCancelFullScreen) {
dwe.webkitCancelFullScreen();
}
this.innerText = '开启网页全屏'
}
}
// 修改成功动画
function saveAnimation() {
var eleTop = -30,
eleOp = 0;
var ele = document.getElementById('saveup');
var qqwa = setInterval(function() {
ele.style.top = eleTop + 'px';
ele.style.opacity = eleOp;
eleTop++;
eleOp += 0.02;
if (eleTop > 20) {
clearInterval(qqwa);
}
}, 8);
setTimeout(function() {
// var eleTop=20,eleOp=1;
var qqwb = setInterval(function() {
ele.style.top = eleTop + 'px';
ele.style.opacity = eleOp;
eleTop--;
eleOp -= 0.02;
if (eleTop < -30) {
document.getElementById('saveChange').disabled = false;
document.getElementById('saveChange').innerText = '保存';
clearInterval(qqwb);
}
},8);
}, 2000);
}
//保存按钮
var cv = document.createElement('div');
cv.id = 'saveup';
cv.style.position = 'absolute';
cv.style.left = '50%';
cv.style.transform = 'translateX(-61%)';
cv.style.width = '100px';
//cv.style.height = '20px';
cv.style.backgroundColor = '#ffffff';
cv.style.borderRadius = '5px';
cv.innerText += '保存成功!!';
cv.style.textAlign = 'center';
var checkedtf;
document.getElementById('saveChange').onclick = function() {
document.getElementById('saveChange').parentNode.appendChild(cv);
saveAnimation();
this.disabled = true;
this.innerText = '☣'
//花絮和推荐
if (document.getElementById('check01t').checked == true) {
checkedtf = true;
} else {
checkedtf = false;
}
localStorage.setItem('tidbits', checkedtf);
//暂停时广告
if (document.getElementById('check02t').checked == true) {
checkedtf = true;
} else {
checkedtf = false;
}
localStorage.setItem('ad1', checkedtf);
//水印logo
if (document.getElementById('check03t').checked == true) {
checkedtf = true;
} else {
checkedtf = false;
}
localStorage.setItem('waterMark', checkedtf);
//头部标题栏
if (document.getElementById('check04t').checked == true) {
checkedtf = true;
} else {
checkedtf = false;
}
localStorage.setItem('title', checkedtf);
//下滑更多
if (document.getElementById('check05t').checked == true) {
checkedtf = true;
} else {
checkedtf = false;
}
localStorage.setItem('moreContent', checkedtf);
//弹幕
if (document.getElementById('check06t').checked == true) {
checkedtf = true;
} else {
checkedtf = false;
}
localStorage.setItem('barrage', checkedtf);
//默认隐藏
if (document.getElementById('check07t').checked == true) {
checkedtf = true;
try{
if(localStorage.getItem('hide')=='false'){
alert('你选择了默认隐藏面板,\n按ctrl+shift+Q既可重新出现')
}
}catch(e){}
} else {
checkedtf = false;
}
localStorage.setItem('hide', checkedtf);
document.getElementById('checkall').checked = false;
//changeED();
}
//刷新页面按钮
document.getElementById('sxym').onclick = function() {
document.getElementById('saveChange').click();
location.reload();
}
//重置按钮
document.getElementById('clearChange').onclick = function() {
localStorage.clear();
document.getElementById('checkall').checked = true;
document.getElementById('checkall').click();
}
//页面加载完执行删除
//window.onload = function() {
changeED();
//}
//最后的执行操作
function changeED() {
//花絮和推荐
if (localStorage.getItem("tidbits") == 'true') {
document.getElementById('check01t').checked = true;
setInterval(function() {
try {
document.getElementById('widget-movie-newtidbits').remove();
} catch (e) {}
try {
document.getElementsByClassName('component-title')[0].parentNode.remove();
} catch (e) {}
try {
document.getElementById('widget-movie-superseries').remove();
} catch (e) {}
try {
document.getElementById('widget-videorezebra').remove();
} catch (e) {}
try {
document.getElementsByClassName('mod_title')[0].remove();
} catch (e) {}
try {
document.getElementsByClassName('mod_mood')[0].remove();
} catch (e) {}
try {
document.getElementsByClassName('figure_list')[0].remove();
} catch (e) {}
try {
document.getElementsByClassName('mod_figure_list_sm')[0].remove();
} catch (e) {}
}, 2000);
} else {
document.getElementById('check01f').checked = true;
}
//暂停时广告
if (localStorage.getItem("ad1") == 'true') {
document.getElementById('check02t').checked = true;
setInterval(function() {
try {
document.getElementsByClassName('cupid-pause-close')[0].parentNode.remove();
} catch (e) {}
try {
document.getElementsByClassName('h5-ext-layer')[0].childNodes[1].remove();
} catch (e) {}
try {
document.getElementsByClassName('txp_ad')[0].remove();
} catch (e) {}
try {
document.getElementsByClassName('txp_ad_center')[0].remove();
} catch (e) {}
}, 2000);
} else {
document.getElementById('check02f').checked = true;
}
//水印logo
if (localStorage.getItem("waterMark") == 'true') {
document.getElementById('check03t').checked = true;
setInterval(function() {
try {
document.getElementsByClassName('iqp-logo-top')[0].remove();
} catch (e) {}
try {
document.getElementsByClassName('txp_waterMark_pic')[0].remove();
} catch (e) {}
try {
document.getElementsByClassName('logo-new')[0].remove();
} catch (e) {}
}, 2000);
} else {
document.getElementById('check03f').checked = true;
}
//标题栏
if (localStorage.getItem("title") == 'true') {
document.getElementById('check04t').checked = true;
setInterval(function() {
try {
var b = document.getElementsByClassName('header-wrap')[0];
b.parentNode.style.backgroundColor = '#292929';
b.remove();
} catch (e) {}
try {
var aqyb = document.getElementById('new_vs_header');
aqyb.parentNode.style.backgroundColor = '#0f0f1e';
aqyb.remove();
} catch (e) {}
try {
var aqyc = document.getElementById('header-contain');
aqyc.parentNode.style.backgroundColor = '#0f0f1e';
aqyc.remove();
} catch (e) {}
}, 2000);
} else {
document.getElementById('check04f').checked = true;
}
//下滑更多
if (localStorage.getItem("moreContent") == 'true') {
document.getElementById('check05t').checked = true;
setInterval(function() {
try {
document.getElementsByClassName('qy-player-side-vip')[0].remove();
} catch (e) {}
try {
document.getElementsByClassName('container_main')[0].remove();
} catch (e) {}
try {
document.getElementById('titleRow').remove();
} catch (e) {}
try {
document.getElementById('contentArea').remove();
} catch (e) {}
try {
document.getElementById('shortcut').remove();
} catch (e) {}
try {
document.getElementById('block-AR').remove();
} catch (e) {}
try {
document.getElementById('container_player').style.height = '2000px';
} catch (e) {}
try {
var aqy_body = document.getElementsByTagName('body')[0];
aqy_body.style.height = '2000px';
aqy_body.style.backgroundColor = '#292929';
aqy_body.style.overflow = 'hidden';
} catch (e) {}
var top = document.body.scrollTop || document.documentElement.scrollTop
scrollBy(0, -top);
}, 2000);
} else {
document.getElementById('check05f').checked = true;
}
//弹幕
if (localStorage.getItem("barrage") == 'true') {
document.getElementById('check06t').checked = true;
setInterval(function() {
try {
document.getElementById('barrage-controller').remove();
} catch (e) {}
try {
document.getElementsByClassName('iqp-barrage-item')[0].remove();
} catch (e) {}
try {
document.getElementsByClassName('barrage-container')[0].remove();
} catch (e) {}
try {
document.getElementsByClassName('txp_comment_hot')[0].remove();
} catch (e) {}
try {
document.getElementsByClassName('qy-barrage')[0].remove();
} catch (e) {}
try {
document.getElementsByClassName('txp_barrage_external')[0].remove();
} catch (e) {}
try {
document.getElementsByClassName('txp_mod_barrage')[0].remove();
} catch (e) {}
}, 2000);
} else {
document.getElementById('check06f').checked = true;
}
if (localStorage.getItem("hide") == 'true') {
document.getElementById('check07t').checked = true;
document.getElementById('callth').click();
} else {
document.getElementById('check07f').checked = true;
}
qaws();
}
function qaws() {
var qxed = false;
for (var j = 0; j < 8; j++) {
try {
if (document.getElementById('check0' + j + 't').checked == true)
qxed = true;
else {
qxed = false;
break;
}
} catch (e) {}
}
if (qxed == true) {
document.getElementById('checkall').checked = true;
} else {
document.getElementById('checkall').checked = false;
}
}
for (i = 0; i < aqy_a.childNodes.length; i++) {
try {
aqy_a.childNodes[i].style.cursor = 'pointer';
if (/^check/.test(aqy_a.childNodes[i].id) && aqy_a.childNodes[i].id != 'checkall') {
aqy_a.childNodes[i].onclick = function() {
qaws();
console.log(1);
}
}
} catch (e) {}
}
//全选
document.getElementById('checkall').onclick = function() {
if (this.checked == true) {
for (var oi = 1; oi < 10; oi++) {
try {
document.getElementById('check0' + oi + 't').checked = true;
} catch (e) {}
}
} else {
for (var pi = 1; pi < 10; pi++) {
try {
document.getElementById('check0' + pi + 'f').checked = true;
} catch (e) {}
}
}
}
//if(/^https:\/\/y\.qq\.com\/n\/yqq\/mv\/v\/*/.test(window.location)){
// setInterval(function() {
// try {
// document.getElementsByClassName('popup_guide')[0].remove();
//} catch (e) {}
// }, 2000);
//}
// Your code here...
})();