Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name 4Anime Hard Subs Blocker
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description block hard coded subtitles
- // @author 透明水晶#6554
- // @match https://4anime.to/*
- // ==/UserScript==
- (function() {
- // Customize rectangle here
- // coordinates and dimensions
- let x = 30;
- let y = 119;
- let width = 240;
- let height = 26;
- // color
- let color = [255,255,255]; // rgb color code
- let vid = document.getElementsByTagName("video")[0];
- let canvas = document.createElement("canvas");
- canvas.id = "paintpad";
- canvas.style.position = "absolute";
- canvas.style.top = 0;
- canvas.style.left = 0;
- canvas.style.width = "100%";
- canvas.style.height = "100%";
- canvas.styleText = "position: absolute; top: 0; left: 0; width: 100%; height: 100%;";
- vid.parentNode.insertBefore(canvas, vid.nextSibling);
- let canv = document.getElementById("paintpad");
- let ctx = canv.getContext("2d");
- ctx.fillStyle = `rgb(${color[0]},${color[1]},${color[2]})`;
- ctx.fillRect(x,y,width,height);
- // uncomment these 4 lines if clicking wont pause the vid
- canv.addEventListener("click", function(){
- if (vid.paused) vid.play();
- else vid.pause()
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement