9gag - darker style and minimalism

Video controls enabled by default and less stuff

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name          9gag - darker style and minimalism
// @namespace     9gag_darker_style
// @version       1.02
// @description   Video controls enabled by default and less stuff
// @match         https://9gag.com/*
// @run-at        document-end
// @grant         unsafeWindow
// ==/UserScript==


if (typeof unsafeWindow === "undefined"){unsafeWindow = window;}


var r = document.querySelector(".section-header");
if(r){r.remove();}
r = document.querySelector(".section-nav");
if(r){r.remove();}
r = document.querySelector(".section-sidebar");
if(r){r.remove();}
r = document.querySelector(".featured-tag");
if(r){r.remove();}
r = document.querySelector("#top-nav")
if(r){r.style.position = "absolute";}
r = document.querySelector(".fixed-wrap-post-bar")
if(r){r.remove();}

var style = document.createElement('style');style.type = 'text/css';style.innerHTML = '.background-white {background-color: grey;} article.post-page .post-container {background-color: grey;} .post-afterbar-a.in-post-top {background-color: silver;} ';document.getElementsByTagName('head')[0].appendChild(style); // I like silver


var currentVideo;
document.onmouseover = function(e){
 if (e.target.tagName == 'VIDEO' && e.target != currentVideo){
     currentVideo = e.target;
     e.target.setAttribute("controls", true);
     e.target.parentNode.parentNode.removeAttribute("target");
     e.target.parentNode.parentNode.href = "javascript: void(0)";
     if(e.target.nextElementSibling.className == "sound-toggle off")
     {
       e.target.nextElementSibling.remove();
		 }
 }
};