// ==UserScript== // @name 抖音时间管理2022.11.6 // @description 自用抖音时间管理 // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match *://*.douyin.com/* // @icon https://img.alicdn.com/imgextra/i4/O1CN01aG16y424E11XsURUd_!!6000000007358-2-tps-206-240.png // @grant none // @license AGPL License // @downloadURL none // ==/UserScript== //定时 setTimeout( function (){try{ document.getElementsByClassName("eV6rINZw")[0].innerHTML = "----------------只看5分钟---------------"; }catch(err){alert("没找到搜索框");}} ,2000) var i = 1; var sj="00:00" setTimeout(function (){ for (let i=0; i<3600; i++)task(i); function task(i) {setTimeout( function () { //console.log(document.getElementsByClassName('time-current')[0].innerText)//输入日记 try{ if(sj>document.getElementsByClassName('time-current')[0].innerText){alert("够钟死心了");window.opener = null; window.open('', '_self'); window.close();} sj=document.getElementsByClassName('time-current')[0].innerText document.getElementsByClassName("eV6rINZw")[0].innerHTML = "----------------5分钟到了+"+i;i++; } catch(err){console.error(err);} }, 1000 * i);}; },5*60*1000);//在5分钟后执行代码 //总长时间 //document.getElementsByClassName('time-duration')[0].innerText; //当前时间 //document.getElementsByClassName('time-current')[0].innerText; //if(document.getElementsByClassName('time-duration')[0].innerText==document.getElementsByClassName('time-current')[0].innerText){alert("够钟死心了");window.opener = null; window.open('', '_self'); window.close();}} //setTimeout(function(){alert("Hello");window.opener = null; window.open('', '_self'); window.close();},5*60*1000);//在一定时间后执行代码 //setTimeout(() => { // console.log(document.getElementsByClassName('time-current')[0].innerText); // }, 1000);//每隔一段时间后执行代码 //setInterval(function shijian(){for(let i=5;i>0;i--){console.log(document.getElementsByClassName('time-current')[0].innerText);}},1000)//每隔一段时间后执行代码