Advertisement
Guest User

Untitled

a guest
Apr 10th, 2020
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         4Anime Hard Subs Blocker
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  block hard coded subtitles
  6. // @author       透明水晶#6554
  7. // @match        https://4anime.to/*
  8.  
  9. // ==/UserScript==
  10.  
  11. (function() {
  12.  
  13.     // Customize rectangle here
  14.     // coordinates and dimensions
  15.     let x = 30;
  16.     let y = 119;
  17.     let width = 240;
  18.     let height = 26;
  19.     // color
  20.     let color = [255,255,255]; // rgb color code
  21.  
  22.     let vid = document.getElementsByTagName("video")[0];
  23.     let canvas = document.createElement("canvas");
  24.     canvas.id = "paintpad";
  25.     canvas.style.position = "absolute";
  26.     canvas.style.top = 0;
  27.     canvas.style.left = 0;
  28.     canvas.style.width = "100%";
  29.     canvas.style.height = "100%";
  30.  
  31.     canvas.styleText = "position: absolute; top: 0; left: 0; width: 100%; height: 100%;";
  32.     vid.parentNode.insertBefore(canvas, vid.nextSibling);
  33.  
  34.  
  35.     let canv = document.getElementById("paintpad");
  36.     let ctx = canv.getContext("2d");
  37.     ctx.fillStyle = `rgb(${color[0]},${color[1]},${color[2]})`;
  38.     ctx.fillRect(x,y,width,height);
  39.  
  40.     // uncomment these 4 lines if clicking wont pause the vid
  41.     canv.addEventListener("click", function(){
  42.     if (vid.paused) vid.play();
  43.     else vid.pause()
  44.     });
  45.  
  46.  
  47. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement