谷歌浏览器永久去除腾讯视频水印
程序员文章站
2022-03-10 09:49:36
...
直播视频必备!我也是别人博客看见的,但是他的知识一次性,换级的时候还是会出来,我拿来改了下!不废话·直接上代码!
- 新建一个文件夹
-
新建文件:manifest.json
{ "manifest_version": 2, "name": "腾讯视频去除水印", "version": "0.0.1", "description": "解决腾讯视频爬虫出现水印的现象,进入谷歌后自动执行去除水印.", "author": "Lux", "content_scripts": [ { "matches": ["https://v.qq.com/x/cover/*"], "run_at": "document_end", "js": ["advertising.js"], "all_frames": true } ] }
-
新建文件:advertising.js
setInterval(function(){ console.log("插件正在清理水印中!") fn(); }, 1000); var thread = function () { var nowTime = 0, maxTime = 15; var threadArr = []; this.addThread = function (fn) { threadArr.push(fn) } this.start=function () { doingThread(); } var doingThread = function () { if (threadArr.length > 0) { if (nowTime < maxTime) { let now = new Date().getTime(); var method = threadArr[0]; method(); threadArr.splice(0, 1); let nowNew = (new Date().getTime() - now); nowTime += nowNew; doingThread(); } else { nowTime=0; setTimeout(doingThread, 1); } }else { setTimeout(doingThread,100) } } } var fn = function () { img = document.querySelectorAll('img.txp_waterMark_pic') if (img.length == 1){ img.forEach(function(a){a.remove()}); return true; } else{ console.log('not img'); return false } } var thread = new thread(); thread.start() try{ for (let i = 0; i < 1000000; i++) { thread.addThread(function () { if (fn()){throw 'jumpout';} }) } }catch(e){}
-
打开谷歌浏览器-右脚上三个点更多工具-扩展程序
-
进入扩展程序,右上角必须是开发者模式,然后点击左边的加载已解压的程序,选择刚刚新建的文件夹,确定 over!!!
推荐阅读