From 7e045e87592f7fb1871f0e756e1170654cf6853d Mon Sep 17 00:00:00 2001 From: Brian Buller Date: Wed, 23 Feb 2022 09:31:06 -0600 Subject: [PATCH] Reset video width with 'W' --- Video Zen.user.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Video Zen.user.js b/Video Zen.user.js index af29d0e..94ada52 100644 --- a/Video Zen.user.js +++ b/Video Zen.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Video Zen // @namespace http://bullercodeworks.com -// @version 0.2 +// @version 0.3 // @description Watch video in 'zen' mode // @author brian@bullercodeworks.com // @match http*://*/* @@ -77,7 +77,6 @@ } function canZen() { var v = document.getElementsByTagName('video')[0]; - console.log(v); return v != null; } function doPressEscape() { @@ -97,6 +96,12 @@ console.log("Zen mode cannot be activated."); } } + function doSetWidthTo100() { + if(zenExists()) { + var v = document.getElementsByTagName('video')[0]; + v.style.width = '100%'; + } + } document.addEventListener('keyup',(e)=>{ console.log("Event Caught"); @@ -104,6 +109,9 @@ case 'Escape': doPressEscape(); break; + case 'KeyW': + doSetWidthTo100(); + break; } }); })();