油猴脚本,自动关闭页面弹窗

// ==UserScript==
// @name         自动关闭oa的聊天弹窗按钮
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        *://oa.zhixueyun.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    var startTime=new Date().getTime();

    var dingShiId= window.setInterval(function(){
//        if(new Date().getTime()-startTime>6000000){
//            //超过6000秒,移除定时器
//            clearInterval(dingShiId)
//        }

        //移除弹窗
        var dl=document.querySelector(".eMobile-modal");
        if(dl!=null){
            //检测到弹窗,移除定时器
            clearInterval(dingShiId)
            dl.remove();
        }

        //定时器:500毫秒一次
    }, 500);

})();
原文地址:https://www.cnblogs.com/wulm/p/15271733.html