Coomer.su prevent auto-download video when click

prevent auto-download video when click in coomer.su

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name                Coomer.su prevent auto-download video when click
// @namespace           https://greasyfork.org/users/821661
// @version             1.0
// @description         prevent auto-download video when click in coomer.su
// @author              hdyzen
// @match               https://coomer.su/*
// @grant               none
// @license             GPL-3.0-only
// ==/UserScript==

document.addEventListener("click", (event) => {
	if (!event.target.matches("a.post__attachment-link[href*='.mp4']")) return;
	event.preventDefault();

	const videoWindow = window.open("");
	videoWindow.document.documentElement.innerHTML = `
	<style>
		body {
			margin:0;
			background:#000;
		}
		video {
			width:100%;
			height:100%;
		}
	</style>
	<video controls src="${event.target.href}"></video>`;
});