刷题必备

限制能打开的网页

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
// ==UserScript==
// @name         刷题必备
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  限制能打开的网页
// @author       https://github.com/ChaunceyBai98
// @match        *
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAjVBMVEX///8yMjIsLCwvLy8pKSkmJiYZGRkXFxcbGxsjIyMkJCQaGhogICAUFBQRERFfX1/h4eH5+fnz8/PNzc3U1NQ2Njbo6Oh6enqqqqpYWFju7u6Tk5NpaWmCgoLc3Nympqa/v79TU1NGRkZxcXG4uLhBQUGMjIygoKDHx8c9PT2ZmZlNTU2Ojo5lZWUGBgZ2YjFWAAAO80lEQVR4nO1dC5eqLBeeQBQLLSstK7s6Xaf+/8/7aiYQTUUFrfN+PmvNWeusCthc9p3N11eLFi1atGjRokWLFi1atGjRokWLFi1atGgcM28wGCzvf97w3UNRC+84PQf9b0SwruuGcf9Hx0TbXoN5OP7nSR2EgQ8tTJAGYCcOCDREepbbn6+9dw+zIparq2WQV9KShCJia5Pwn6PyGLiWCXJp48nUiLH9Gb170IXhhDsLa/lLl0Il0klwfPfYi2AcIKyVpI5C0zvzwbsJEGC6taqS91xJ21+/m4hseD9dkrc5IbhDu//BvG8B3Dl8phAZTGyUQRgysW7dyGnTvy52i2t/4+q2pRMzg9FCU9/P3k3OCwY7O217AoQN199Pj8vkkL3xehVsoEVQGstF9ofROJuk0Ae6utU/H3NH6njrn42N0etaIn3uNDV8IZz97YU+QHT/MC7YwGh+SZGeXTytddjFEYLuC3nGIizHLbzpxjKTK4m3ReeoTgw2emJgyN6EVTbY7PCdFDXwNnn7Vj0Y8d0FSfenutAeBzghbxBZqxtsBXhbEt+exjaUa9GZnnoxGqG1e+MyTuMLCIyNCsVyvY3vewTepZM7Cz022cZG1UiOW8zTCO25oobLYeDyKgzEW5WGQejGtj/pv2Gnrg1+mpGpWnYdYnxVg0vF7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wDL13Jxmc/Mk5XH6W2iILZ+bdMbj/zYb/LcpatGjRokWLFi1atGjRokWLFi1atPh/wP8AL4XVFFIXxLcAAAAASUVORK5CYII=
// @license      MIT
// @grant        none
// ==/UserScript==
(function() {
  'use strict';
  var whitelist = ['leetcode','mail','google','extension','usc','jianshu','csdn','BV11Z4y157RY','BV1tp4y1i7rL','video','python','java'];
  var blacklist = ['tieba.baidu','nga','popular','yhdmp','uhaozu','bilibili','youtube','1point3acres'];
    //,'nga','popular','yhdmp','uhaozu'
  var quanPiPeiBlackList = ['https://www.bilibili.com/','https://www.bilibili.com/?spm_id_from=333.788.0.0']
  var currentURL = window.location.href;
  var counter = 0;
  var flag = true;
  for (let i = 0; i < blacklist.length; i++) {
    if(currentURL.includes(blacklist[i])){
      //false 不能看
      flag = false;
      break;
    }
  }
  for (let i = 0; i < whitelist.length; i++) {
    if(currentURL.includes(whitelist[i])){
      //true 能看
      flag = true;
      break;
    }
  }
  // for (let i = 0; i < quanPiPeiBlackList.length; i++) {
  //   if(currentURL == quanPiPeiBlackList[i]){
  //     //true 能看
  //     flag = false;
  //     break;
  //   }
  // }
  if(!flag){
    document.head.innerHTML = '<meta charset="UTF-8">'+
      '<link href="https://g.csdnimg.cn/static/logo/favicon32.ico" rel="shortcut icon" type="image/x-icon">'+
      '<meta content="">'+
      '<title>劝学</title>';
    document.body.innerHTML = '<div align="center">'+
      '</br>'+
      '</br>'+
      '</br>'+
      '</br>'+
      '</br>'+
      '</br>'+
      '<h1 style="color: #FF0000;">不要摄取过多杂乱无章的信息</h1>'+
      '</div>'
    ;
  }
// Your code here...
})();